summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_edit.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-04-27 20:18:31 +0200
committerBram Moolenaar <Bram@vim.org>2020-04-27 20:18:31 +0200
commitdb93495d276642f63f80471fbcb900b9aa1e9e42 (patch)
treefca8ecb1216bbce25b08f87f2ec5857df935ab8b /src/testdir/test_edit.vim
parent0e71704b77a9891ccae9f5a9c7429e933078f232 (diff)
patch 8.2.0649: undo problem whn an InsertLeave autocommand resets undov8.2.0649
Problem: Undo problem whn an InsertLeave autocommand resets undo. (Kutsan Kaplan) Solution: Do not create a new undo block when leaving Insert mode.
Diffstat (limited to 'src/testdir/test_edit.vim')
-rw-r--r--src/testdir/test_edit.vim17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/testdir/test_edit.vim b/src/testdir/test_edit.vim
index ce55f6be0b..a9ba31df4c 100644
--- a/src/testdir/test_edit.vim
+++ b/src/testdir/test_edit.vim
@@ -1444,7 +1444,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
@@ -1474,6 +1474,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