There's a problem with "langmap" and expression mappings, but also normal ones:

    :inoremap <expr> } "X"
    :set langmap=+} langnoremap

This will insert "X" when typing "+" in insert mode, but it should be "+".

This is caused / not correctly handled by the "|| (p_lnr && typebuf_maplen() == 
0 )" condition in the macro:

#  define LANGMAP_ADJUST(c, condition) \
    do { \
        if (*p_langmap \
                && (condition) \
                && (!p_lnr || (p_lnr && typebuf_maplen() == 0 )) \
                && !KeyStuffed \
                && (c) >= 0) \
        { \
            if ((c) < 256) \
                c = langmap_mapchar[c]; \
            else \
                c = langmap_adjust_mb(c); \
        } \
    } while (0)

"typebuf_maplen() == 0" could be written as "typebuf_typed()" btw.

`:call feedkeys('i+')` works (inserts the "+").

A fix for this (with tests) is at: 
https://github.com/blueyed/vim/compare/fix-langmap-in-insmode?expand=1 (and 
attached).

I could imagine that this breaks something, but at least no other tests.

I've noticed this bug with delimitMate: 
https://github.com/Raimondi/delimitMate/issues/197


Regards,
Daniel.

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.
>From 4f028eb9413c131e7b303b359c89756c61a22ace Mon Sep 17 00:00:00 2001
From: Daniel Hahler <[email protected]>
Date: Sat, 13 Dec 2014 03:34:30 +0100
Subject: [PATCH] Do not apply LANGMAP_ADJUST in insert mode

---
 src/getchar.c               | 2 +-
 src/testdir/test_mapping.in | 9 +++++++++
 src/testdir/test_mapping.ok | 2 ++
 3 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/src/getchar.c b/src/getchar.c
index c9ee4d0..6a34976 100644
--- a/src/getchar.c
+++ b/src/getchar.c
@@ -2145,7 +2145,7 @@ vgetorpeek(advance)
 			    nolmaplen = 2;
 			else
 			{
-			    LANGMAP_ADJUST(c1, TRUE);
+			    LANGMAP_ADJUST(c1, State != INSERT);
 			    nolmaplen = 0;
 			}
 #endif
diff --git a/src/testdir/test_mapping.in b/src/testdir/test_mapping.in
index e257277..5f895a4 100644
--- a/src/testdir/test_mapping.in
+++ b/src/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 <expr> { "FAIL_iexplangmap"
+o+
+
 :/^test/,$w! test.out
 :qa!
 ENDTEST
diff --git a/src/testdir/test_mapping.ok b/src/testdir/test_mapping.ok
index abdaea6..8d94976 100644
--- a/src/testdir/test_mapping.ok
+++ b/src/testdir/test_mapping.ok
@@ -1,2 +1,4 @@
 test starts here:
 vim
++
++

Raspunde prin e-mail lui