Mercurial > vim
comparison src/testdir/test_edit.vim @ 14985:4ebda55537a5 v8.1.0504
patch 8.1.0504: when CTRL-C is mapped it triggers InsertLeave
commit https://github.com/vim/vim/commit/4dbc2627641a6b950c30c31cbf7b7e6c36da1927
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Nov 2 11:59:15 2018 +0100
patch 8.1.0504: when CTRL-C is mapped it triggers InsertLeave
Problem: When CTRL-C is mapped it triggers InsertLeave.
Solution: Make CTRL-C behave the same way when typed or used in a mapping.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 02 Nov 2018 12:00:07 +0100 |
parents | 9ffce640d0d3 |
children | 63b02fcf1361 |
comparison
equal
deleted
inserted
replaced
14984:28fde4aa8534 | 14985:4ebda55537a5 |
---|---|
1407 call assert_equal(3, line('.')) | 1407 call assert_equal(3, line('.')) |
1408 | 1408 |
1409 bwipe XAltFile | 1409 bwipe XAltFile |
1410 call delete('XAltFile') | 1410 call delete('XAltFile') |
1411 endfunc | 1411 endfunc |
1412 | |
1413 func Test_leave_insert_autocmd() | |
1414 new | |
1415 au InsertLeave * let g:did_au = 1 | |
1416 let g:did_au = 0 | |
1417 call feedkeys("afoo\<Esc>", 'tx') | |
1418 call assert_equal(1, g:did_au) | |
1419 call assert_equal('foo', getline(1)) | |
1420 | |
1421 let g:did_au = 0 | |
1422 call feedkeys("Sbar\<C-C>", 'tx') | |
1423 call assert_equal(0, g:did_au) | |
1424 call assert_equal('bar', getline(1)) | |
1425 | |
1426 inoremap x xx<Esc> | |
1427 let g:did_au = 0 | |
1428 call feedkeys("Saax", 'tx') | |
1429 call assert_equal(1, g:did_au) | |
1430 call assert_equal('aaxx', getline(1)) | |
1431 | |
1432 inoremap x xx<C-C> | |
1433 let g:did_au = 0 | |
1434 call feedkeys("Sbbx", 'tx') | |
1435 call assert_equal(0, g:did_au) | |
1436 call assert_equal('bbxx', getline(1)) | |
1437 | |
1438 bwipe! | |
1439 au! InsertLeave | |
1440 iunmap x | |
1441 endfunc |