forked from aniani/vim
patch 8.2.4941: '[ and '] marks may be wrong after undo
Problem: '[ and '] marks may be wrong after undo. Solution: Adjust the '[ and '] marks if needed. (closes #10407, closes #1281)
This commit is contained in:
@@ -756,4 +756,21 @@ func Test_redo_multibyte_in_insert_mode()
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
func Test_undo_mark()
|
||||
new
|
||||
" The undo is applied to the only line.
|
||||
call setline(1, 'hello')
|
||||
call feedkeys("ggyiw$p", 'xt')
|
||||
undo
|
||||
call assert_equal([0, 1, 1, 0], getpos("'["))
|
||||
call assert_equal([0, 1, 1, 0], getpos("']"))
|
||||
" The undo removes the last line.
|
||||
call feedkeys("Goaaaa\<Esc>", 'xt')
|
||||
call feedkeys("obbbb\<Esc>", 'xt')
|
||||
undo
|
||||
call assert_equal([0, 2, 1, 0], getpos("'["))
|
||||
call assert_equal([0, 2, 1, 0], getpos("']"))
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
" vim: shiftwidth=2 sts=2 expandtab
|
||||
|
||||
Reference in New Issue
Block a user