Mercurial > vim
comparison src/testdir/test_termcodes.vim @ 18717:14d2a210fab1 v8.1.2350
patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Commit: https://github.com/vim/vim/commit/fc4ea2a72d36de1196a3ce17352e72f8fe90f4bb
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Nov 26 19:33:22 2019 +0100
patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Problem: Other text for CTRL-V in Insert mode with modifyOtherKeys.
Solution: Convert the Escape sequence back to key as if modifyOtherKeys is
not set, and use CTRL-SHIFT-V to get the Escape sequence itself.
(closes #5254)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 26 Nov 2019 19:45:04 +0100 |
parents | ac08c7ad9d37 |
children | 5c256866b837 |
comparison
equal
deleted
inserted
replaced
18716:9568bc68c45d | 18717:14d2a210fab1 |
---|---|
1347 | 1347 |
1348 func Test_mapping_works_with_shift_ctrl_alt() | 1348 func Test_mapping_works_with_shift_ctrl_alt() |
1349 call RunTest_mapping_works_with_mods(function('GetEscCodeCSI27'), 'C-S-A', 8) | 1349 call RunTest_mapping_works_with_mods(function('GetEscCodeCSI27'), 'C-S-A', 8) |
1350 call RunTest_mapping_works_with_mods(function('GetEscCodeCSIu'), 'C-S-A', 8) | 1350 call RunTest_mapping_works_with_mods(function('GetEscCodeCSIu'), 'C-S-A', 8) |
1351 endfunc | 1351 endfunc |
1352 | |
1353 func Test_insert_literal() | |
1354 set timeoutlen=10 | |
1355 new | |
1356 " CTRL-V CTRL-X inserts a ^X | |
1357 call feedkeys('a' .. GetEscCodeCSIu('V', '5') .. GetEscCodeCSIu('X', '5') .. "\<Esc>", 'Lx!') | |
1358 call assert_equal("\<C-X>", getline(1)) | |
1359 | |
1360 call setline(1, '') | |
1361 call feedkeys('a' .. GetEscCodeCSI27('V', '5') .. GetEscCodeCSI27('X', '5') .. "\<Esc>", 'Lx!') | |
1362 call assert_equal("\<C-X>", getline(1)) | |
1363 | |
1364 " CTRL-SHIFT-V CTRL-X inserts escape sequencd | |
1365 call setline(1, '') | |
1366 call feedkeys('a' .. GetEscCodeCSIu('V', '6') .. GetEscCodeCSIu('X', '5') .. "\<Esc>", 'Lx!') | |
1367 call assert_equal("\<Esc>[88;5u", getline(1)) | |
1368 | |
1369 call setline(1, '') | |
1370 call feedkeys('a' .. GetEscCodeCSI27('V', '6') .. GetEscCodeCSI27('X', '5') .. "\<Esc>", 'Lx!') | |
1371 call assert_equal("\<Esc>[27;5;88~", getline(1)) | |
1372 | |
1373 bwipe! | |
1374 set timeoutlen& | |
1375 endfunc | |
1376 | |
1377 func Test_cmdline_literal() | |
1378 set timeoutlen=10 | |
1379 | |
1380 " CTRL-V CTRL-Y inserts a ^Y | |
1381 call feedkeys(':' .. GetEscCodeCSIu('V', '5') .. GetEscCodeCSIu('Y', '5') .. "\<C-B>\"\<CR>", 'Lx!') | |
1382 call assert_equal("\"\<C-Y>", @:) | |
1383 | |
1384 call feedkeys(':' .. GetEscCodeCSI27('V', '5') .. GetEscCodeCSI27('Y', '5') .. "\<C-B>\"\<CR>", 'Lx!') | |
1385 call assert_equal("\"\<C-Y>", @:) | |
1386 | |
1387 " CTRL-SHIFT-V CTRL-Y inserts escape sequencd | |
1388 call feedkeys(':' .. GetEscCodeCSIu('V', '6') .. GetEscCodeCSIu('Y', '5') .. "\<C-B>\"\<CR>", 'Lx!') | |
1389 call assert_equal("\"\<Esc>[89;5u", @:) | |
1390 | |
1391 call setline(1, '') | |
1392 call feedkeys(':' .. GetEscCodeCSI27('V', '6') .. GetEscCodeCSI27('Y', '5') .. "\<C-B>\"\<CR>", 'Lx!') | |
1393 call assert_equal("\"\<Esc>[27;5;89~", @:) | |
1394 | |
1395 set timeoutlen& | |
1396 endfunc |