mirror of
https://github.com/vim/vim.git
synced 2025-11-06 10:07:45 -05:00
patch 8.0.0205: wrong behavior after :undojoin
Problem: After :undojoin some commands don't work properly, such as :redo.
(Matthew Malcomson)
Solution: Don't set curbuf->b_u_curhead. (closes #1390)
This commit is contained in:
@@ -176,7 +176,17 @@ func Test_undojoin()
|
|||||||
call assert_equal(['aaaa', 'bbbb', 'cccc'], getline(2, '$'))
|
call assert_equal(['aaaa', 'bbbb', 'cccc'], getline(2, '$'))
|
||||||
call feedkeys("u", 'xt')
|
call feedkeys("u", 'xt')
|
||||||
call assert_equal(['aaaa'], getline(2, '$'))
|
call assert_equal(['aaaa'], getline(2, '$'))
|
||||||
close!
|
bwipe!
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
func Test_undojoin_redo()
|
||||||
|
new
|
||||||
|
call setline(1, ['first line', 'second line'])
|
||||||
|
call feedkeys("ixx\<Esc>", 'xt')
|
||||||
|
call feedkeys(":undojoin | redo\<CR>", 'xt')
|
||||||
|
call assert_equal('xxfirst line', getline(1))
|
||||||
|
call assert_equal('second line', getline(2))
|
||||||
|
bwipe!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_undo_write()
|
func Test_undo_write()
|
||||||
|
|||||||
@@ -3136,11 +3136,8 @@ ex_undojoin(exarg_T *eap UNUSED)
|
|||||||
if (get_undolevel() < 0)
|
if (get_undolevel() < 0)
|
||||||
return; /* no entries, nothing to do */
|
return; /* no entries, nothing to do */
|
||||||
else
|
else
|
||||||
{
|
/* Append next change to the last entry */
|
||||||
/* Go back to the last entry */
|
curbuf->b_u_synced = FALSE;
|
||||||
curbuf->b_u_curhead = curbuf->b_u_newhead;
|
|
||||||
curbuf->b_u_synced = FALSE; /* no entries, nothing to do */
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -764,6 +764,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
205,
|
||||||
/**/
|
/**/
|
||||||
204,
|
204,
|
||||||
/**/
|
/**/
|
||||||
|
|||||||
Reference in New Issue
Block a user