summaryrefslogtreecommitdiff
path: root/src/testdir/test_langmap.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-01-21 23:32:32 +0100
committerBram Moolenaar <Bram@vim.org>2016-01-21 23:32:32 +0100
commit25281634cda03ce302aaf9f906a9520b5f81f91e (patch)
treeccc62740f7af898d7be19893f8972baf3aa3013f /src/testdir/test_langmap.vim
parentd6357e8f93c50f984ffd69c3a0d247d8603f86c3 (diff)
downloadvim-git-25281634cda03ce302aaf9f906a9520b5f81f91e.tar.gz
patch 7.4.1150v7.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().
Diffstat (limited to 'src/testdir/test_langmap.vim')
-rw-r--r--src/testdir/test_langmap.vim24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/testdir/test_langmap.vim b/src/testdir/test_langmap.vim
new file mode 100644
index 000000000..066c3bf2b
--- /dev/null
+++ b/src/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\<Esc>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}%}\<C-G>}^\<Esc>00", 'tx')
+ call assert_equal('a}^de', getline(1))
+
+ quit!
+endfunc