diff options
| author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-04-28 19:05:07 -0400 |
|---|---|---|
| committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-05-03 13:16:37 -0400 |
| commit | cf9887c838d6b38648d25bb82d6ee569549a5c63 (patch) | |
| tree | 3de12c5e4d5976e13d6375f174bfbb8906bab7d6 /src/nvim/testdir | |
| parent | a576bf6196a66a0542af82c51e77e51d90a80c67 (diff) | |
| download | rneovim-cf9887c838d6b38648d25bb82d6ee569549a5c63.tar.gz rneovim-cf9887c838d6b38648d25bb82d6ee569549a5c63.tar.bz2 rneovim-cf9887c838d6b38648d25bb82d6ee569549a5c63.zip | |
vim-patch:8.2.0649: undo problem whn an InsertLeave autocommand resets undo
Problem: Undo problem whn an InsertLeave autocommand resets undo. (Kutsan
Kaplan)
Solution: Do not create a new undo block when leaving Insert mode.
https://github.com/vim/vim/commit/db93495d276642f63f80471fbcb900b9aa1e9e42
Diffstat (limited to 'src/nvim/testdir')
| -rw-r--r-- | src/nvim/testdir/test_edit.vim | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/nvim/testdir/test_edit.vim b/src/nvim/testdir/test_edit.vim index 98fa9a3c47..12d5d9790e 100644 --- a/src/nvim/testdir/test_edit.vim +++ b/src/nvim/testdir/test_edit.vim @@ -1439,7 +1439,7 @@ func Test_edit_alt() call delete('XAltFile') endfunc -func Test_leave_insert_autocmd() +func Test_edit_InsertLeave() new au InsertLeave * let g:did_au = 1 let g:did_au = 0 @@ -1469,6 +1469,21 @@ func Test_leave_insert_autocmd() iunmap x endfunc +func Test_edit_InsertLeave_undo() + new XtestUndo + set undofile + au InsertLeave * wall + exe "normal ofoo\<Esc>" + call assert_equal(2, line('$')) + normal u + call assert_equal(1, line('$')) + + bwipe! + au! InsertLeave + call delete('XtestUndo') + set undofile& +endfunc + " Test for inserting characters using CTRL-V followed by a number. func Test_edit_special_chars() new |