0
0
mirror of https://github.com/vim/vim.git synced 2025-11-01 10:07:16 -04: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:
Bram Moolenaar
2017-01-17 22:09:45 +01:00
parent eb46f8fa14
commit 5e4e1b1299
3 changed files with 15 additions and 6 deletions

View File

@@ -176,7 +176,17 @@ func Test_undojoin()
call assert_equal(['aaaa', 'bbbb', 'cccc'], getline(2, '$'))
call feedkeys("u", 'xt')
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
func Test_undo_write()

View File

@@ -3136,11 +3136,8 @@ ex_undojoin(exarg_T *eap UNUSED)
if (get_undolevel() < 0)
return; /* no entries, nothing to do */
else
{
/* Go back to the last entry */
curbuf->b_u_curhead = curbuf->b_u_newhead;
curbuf->b_u_synced = FALSE; /* no entries, nothing to do */
}
/* Append next change to the last entry */
curbuf->b_u_synced = FALSE;
}
/*

View File

@@ -764,6 +764,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
205,
/**/
204,
/**/