summaryrefslogtreecommitdiffstats
path: root/src/macros.h
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2014-11-05 17:44:52 +0100
committerBram Moolenaar <Bram@vim.org>2014-11-05 17:44:52 +0100
commit4391cf98ec3b94f33dfd053cab25ed56c787bea9 (patch)
tree66e0561154ddd7794d1b220d2b0d2e1faf3ea180 /src/macros.h
parentc3940c76e8248ea7f618b3f1716d754c8e981f35 (diff)
updated for version 7.4.502v7.4.502
Problem: Language mapping also applies to mapped characters. Solution: Add the 'langnoremap' option, when on 'langmap' does not apply to mapped characters. (Christian Brabandt)
Diffstat (limited to 'src/macros.h')
-rw-r--r--src/macros.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/macros.h b/src/macros.h
index 2706a02524..01207d91b3 100644
--- a/src/macros.h
+++ b/src/macros.h
@@ -128,13 +128,18 @@
* Adjust chars in a language according to 'langmap' option.
* NOTE that there is no noticeable overhead if 'langmap' is not set.
* When set the overhead for characters < 256 is small.
- * Don't apply 'langmap' if the character comes from the Stuff buffer.
+ * Don't apply 'langmap' if the character comes from the Stuff buffer or from
+ * a mapping and the langnoremap option was set.
* The do-while is just to ignore a ';' after the macro.
*/
# ifdef FEAT_MBYTE
# define LANGMAP_ADJUST(c, condition) \
do { \
- if (*p_langmap && (condition) && !KeyStuffed && (c) >= 0) \
+ if (*p_langmap \
+ && (condition) \
+ && (!p_lnr || (p_lnr && typebuf_maplen() == 0)) \
+ && !KeyStuffed \
+ && (c) >= 0) \
{ \
if ((c) < 256) \
c = langmap_mapchar[c]; \
@@ -145,7 +150,11 @@
# else
# define LANGMAP_ADJUST(c, condition) \
do { \
- if (*p_langmap && (condition) && !KeyStuffed && (c) >= 0 && (c) < 256) \
+ if (*p_langmap \
+ && (condition) \
+ && (!p_lnr || (p_lnr && typebuf_maplen() == 0)) \
+ && !KeyStuffed \
+ && (c) >= 0 && (c) < 256) \
c = langmap_mapchar[c]; \
} while (0)
# endif