neovim/neovim — pull request #1742 by fwalch (2014-12-26 15:56:40+00:00)
Title: [RFC] vim-patch:7.4.552

```
Problem: Langmap applies to Insert mode expression mappings.
Solution: Check for Insert mode. (Daniel Hahler)
```

https://code.google.com/p/vim/source/detail?r=v7-4-552

Original patch:

```diff
diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c
--- a/src/nvim/getchar.c
+++ b/src/nvim/getchar.c
@@ -2145,7 +2145,7 @@ vgetorpeek(advance)
nolmaplen = 2;
else
{
-	LANGMAP_ADJUST(c1, TRUE);
+	LANGMAP_ADJUST(c1, (State & INSERT) == 0);
nolmaplen = 0;
}
#endif
diff --git a/src/nvim/testdir/test_mapping.in b/src/nvim/testdir/test_mapping.in
--- a/src/nvim/testdir/test_mapping.in
+++ b/src/nvim/testdir/test_mapping.in
@@ -8,6 +8,15 @@ STARTTEST
:inoreab чкпр vim
GAчкпр
^[
+
+: " langmap should not get remapped in insert mode
+:inoremap { FAIL_ilangmap
+:set langmap=+{ langnoremap
+o+^[
+: " expr mapping with langmap
+:inoremap { "FAIL_iexplangmap"
+o+^[
+
:/^test/,$w! test.out
:qa!
ENDTEST
diff --git a/src/nvim/testdir/test_mapping.ok b/src/nvim/testdir/test_mapping.ok
--- a/src/nvim/testdir/test_mapping.ok
+++ b/src/nvim/testdir/test_mapping.ok
@@ -1,2 +1,4 @@
test starts here:
vim
++
++
diff --git a/src/nvim/version.c b/src/nvim/version.c
--- a/src/nvim/version.c
+++ b/src/nvim/version.c
@@ -742,6 +742,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 552,
+/**/
551,
/**/
550,
```

Verified that the modified test doesn't pass until the `getchar` change is added.