From 990c0350aba4553baa980ff9305d67ebae1b2aef Mon Sep 17 00:00:00 2001 From: Marco Hinz Date: Tue, 21 Jul 2015 15:11:56 +0200 Subject: vim-patch:7.4.773 #3066 Problem: 'langmap' is used in command-line mode when checking for mappings. Solution: Do not use 'langmap' in command-line mode. (Larry Velazquez) Original patch: https://code.google.com/p/vim/source/detail?r=5b1eefbf9a532f32a66fa13abbd671488aaafd5c --- src/nvim/getchar.c | 2 +- src/nvim/version.c | 2 +- test/functional/legacy/mapping_spec.lua | 13 ++++++++++++- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c index bbeef376b0..6a6e4f2214 100644 --- a/src/nvim/getchar.c +++ b/src/nvim/getchar.c @@ -1758,7 +1758,7 @@ static int vgetorpeek(int advance) if (c1 == K_SPECIAL) nolmaplen = 2; else { - LANGMAP_ADJUST(c1, (State & INSERT) == 0); + LANGMAP_ADJUST(c1, (State & (CMDLINE | INSERT)) == 0); nolmaplen = 0; } /* First try buffer-local mappings. */ diff --git a/src/nvim/version.c b/src/nvim/version.c index 991d4b9264..4b9142323d 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -88,7 +88,7 @@ static int included_patches[] = { 776, 775, 774, - //773, + 773, //772, //771, //770, diff --git a/test/functional/legacy/mapping_spec.lua b/test/functional/legacy/mapping_spec.lua index c387d7484c..0843506827 100644 --- a/test/functional/legacy/mapping_spec.lua +++ b/test/functional/legacy/mapping_spec.lua @@ -23,16 +23,27 @@ describe('mapping', function() execute('set langmap=+{ langnoremap') feed('o+') - -- expr mapping with langmap. + -- Insert mode expr mapping with langmap. execute('inoremap { "FAIL_iexplangmap"') feed('o+') + -- langmap should not get remapped in cmdline mode. + execute('cnoremap { FAIL_clangmap') + feed('o+') + execute('cunmap {') + + -- cmdline mode expr mapping with langmap. + execute('cnoremap { "FAIL_cexplangmap"') + feed('o+') + execute('cunmap {') -- Assert buffer contents. expect([[ test starts here: vim + + + + + +]]) end) end) -- cgit