aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2018-11-03 07:04:33 -0400
committerJustin M. Keyes <justinkz@gmail.com>2018-11-03 12:04:33 +0100
commita6661178aa5dc2f1687131685423cb72f28e141a (patch)
treec2035127ab52eba21a6619fa317b5d1d6848e2bf /src/nvim/testdir
parent87d67814e58b875a1cb4de4c39c252e028b5eafb (diff)
downloadrneovim-a6661178aa5dc2f1687131685423cb72f28e141a.tar.gz
rneovim-a6661178aa5dc2f1687131685423cb72f28e141a.tar.bz2
rneovim-a6661178aa5dc2f1687131685423cb72f28e141a.zip
vim-patch:8.1.0504: when CTRL-C is mapped it triggers InsertLeave (#9192)
Problem: When CTRL-C is mapped it triggers InsertLeave. Solution: Make CTRL-C behave the same way when typed or used in a mapping. https://github.com/vim/vim/commit/4dbc2627641a6b950c30c31cbf7b7e6c36da1927
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_edit.vim30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_edit.vim b/src/nvim/testdir/test_edit.vim
index b1fce07f39..f8946c6929 100644
--- a/src/nvim/testdir/test_edit.vim
+++ b/src/nvim/testdir/test_edit.vim
@@ -1413,3 +1413,33 @@ func Test_edit_alt()
bwipe XAltFile
call delete('XAltFile')
endfunc
+
+func Test_leave_insert_autocmd()
+ new
+ au InsertLeave * let g:did_au = 1
+ let g:did_au = 0
+ call feedkeys("afoo\<Esc>", 'tx')
+ call assert_equal(1, g:did_au)
+ call assert_equal('foo', getline(1))
+
+ let g:did_au = 0
+ call feedkeys("Sbar\<C-C>", 'tx')
+ call assert_equal(0, g:did_au)
+ call assert_equal('bar', getline(1))
+
+ inoremap x xx<Esc>
+ let g:did_au = 0
+ call feedkeys("Saax", 'tx')
+ call assert_equal(1, g:did_au)
+ call assert_equal('aaxx', getline(1))
+
+ inoremap x xx<C-C>
+ let g:did_au = 0
+ call feedkeys("Sbbx", 'tx')
+ call assert_equal(0, g:did_au)
+ call assert_equal('bbxx', getline(1))
+
+ bwipe!
+ au! InsertLeave
+ iunmap x
+endfunc