changeset 6907:5b1eefbf9a53 v7.4.773

patch 7.4.773 Problem: 'langmap' is used in command-line mode when checking for mappings. Issue 376. Solution: Do not use 'langmap' in command-line mode. (Larry Velazquez)
author Bram Moolenaar <bram@vim.org>
date Fri, 10 Jul 2015 17:19:30 +0200
parents 0540e823bca7
children eaa0877e3455
files src/getchar.c src/testdir/test_mapping.in src/testdir/test_mapping.ok src/version.c
diffstat 4 files changed, 16 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/getchar.c
+++ b/src/getchar.c
@@ -2145,7 +2145,8 @@ vgetorpeek(advance)
 			    nolmaplen = 2;
 			else
 			{
-			    LANGMAP_ADJUST(c1, (State & INSERT) == 0);
+			    LANGMAP_ADJUST(c1,
+					   (State & (CMDLINE | INSERT)) == 0);
 			    nolmaplen = 0;
 			}
 #endif
--- a/src/testdir/test_mapping.in
+++ b/src/testdir/test_mapping.in
@@ -28,9 +28,18 @@ GV
 :inoremap { FAIL_ilangmap
 :set langmap=+{ langnoremap
 o+
-: " expr mapping with langmap
+:" Insert-mode expr mapping with langmap
 :inoremap <expr> { "FAIL_iexplangmap"
 o+
+:" langmap should not get remapped in Command-line mode
+:cnoremap { FAIL_clangmap
+:call append(line('$'), '+')
+:cunmap {
+:" Command-line mode expr mapping with langmap
+:cnoremap <expr> { "FAIL_cexplangmap"
+:call append(line('$'), '+')
+:cunmap {
+:"
 :" issue #212 (feedkeys insert mapping at current position)
 :nnoremap . :call feedkeys(".", "in")<cr>
 :/^a b
--- a/src/testdir/test_mapping.ok
+++ b/src/testdir/test_mapping.ok
@@ -8,3 +8,5 @@ TEST2: CTRL-C |<ctrl-c>A|
 vmap works
 +
 +
++
++
--- a/src/version.c
+++ b/src/version.c
@@ -742,6 +742,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    773,
+/**/
     772,
 /**/
     771,