From 40e7efe91cb60fc65eafece2c923a527d55de20d Mon Sep 17 00:00:00 2001 From: Michael Ennen Date: Sun, 22 May 2016 01:25:36 -0700 Subject: vim-patch:7.4.1150 Problem: 'langmap' applies to the first character typed in Select mode. (David Watson) Solution: Check for SELECTMODE. (Christian Brabandt, closes #572) Add the 'x' flag to feedkeys(). https://github.com/vim/vim/commit/25281634cda03ce302aaf9f906a9520b5f81f91e --- src/nvim/testdir/Makefile | 1 + src/nvim/testdir/test_langmap.vim | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 src/nvim/testdir/test_langmap.vim (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/Makefile b/src/nvim/testdir/Makefile index b06efc9ffb..b9ec1cfb2c 100644 --- a/src/nvim/testdir/Makefile +++ b/src/nvim/testdir/Makefile @@ -38,6 +38,7 @@ SCRIPTS := \ NEW_TESTS = \ test_cursor_func.res \ test_help_tagjump.res \ + test_langmap.res \ test_menu.res \ test_syntax.res \ test_timers.res \ diff --git a/src/nvim/testdir/test_langmap.vim b/src/nvim/testdir/test_langmap.vim new file mode 100644 index 0000000000..fc7c6734b1 --- /dev/null +++ b/src/nvim/testdir/test_langmap.vim @@ -0,0 +1,24 @@ +" tests for 'langmap' + +func Test_langmap() + new + set langmap=}l,^x,%v + + call setline(1, ['abc']) + call feedkeys('gg0}^', 'tx') + call assert_equal('ac', getline(1)) + + " in Replace mode + " need silent! to avoid a delay when entering Insert mode + call setline(1, ['abcde']) + silent! call feedkeys("gg0lR%{z\00", 'tx') + call assert_equal('a%{ze', getline(1)) + + " in Select mode + " need silent! to avoid a delay when entering Insert mode + call setline(1, ['abcde']) + silent! call feedkeys("gg0}%}\}^\00", 'tx') + call assert_equal('a}^de', getline(1)) + + quit! +endfunc -- cgit