summaryrefslogtreecommitdiffstats
path: root/src/macros.h
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2009-02-21 19:28:48 +0000
committerBram Moolenaar <Bram@vim.org>2009-02-21 19:28:48 +0000
commit28e8d278683dbc632fcb89cfd7f1ca0ac529a5be (patch)
tree43cb635de4e75a8cfb89627a4a23293bca1372da /src/macros.h
parentf69d9a354b62ced91e99c0004706bebca7c2d96d (diff)
updated for version 7.2-109v7.2.109
Diffstat (limited to 'src/macros.h')
-rw-r--r--src/macros.h26
1 files changed, 21 insertions, 5 deletions
diff --git a/src/macros.h b/src/macros.h
index f223099596..afe3572bb7 100644
--- a/src/macros.h
+++ b/src/macros.h
@@ -127,15 +127,31 @@
#ifdef FEAT_LANGMAP
/*
* Adjust chars in a language according to 'langmap' option.
- * NOTE that there is NO overhead if 'langmap' is not set; but even
- * when set we only have to do 2 ifs and an array lookup.
+ * 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.
* The do-while is just to ignore a ';' after the macro.
*/
-# define LANGMAP_ADJUST(c, condition) do { \
- if (*p_langmap && (condition) && !KeyStuffed && (c) >= 0 && (c) < 256) \
- c = langmap_mapchar[c]; \
+# ifdef FEAT_MBYTE
+# define LANGMAP_ADJUST(c, condition) \
+ do { \
+ if (*p_langmap && (condition) && !KeyStuffed && (c) >= 0) \
+ { \
+ if ((c) < 256) \
+ c = langmap_mapchar[c]; \
+ else \
+ c = langmap_adjust_mb(c); \
+ } \
} while (0)
+# else
+# define LANGMAP_ADJUST(c, condition) \
+ do { \
+ if (*p_langmap && (condition) && !KeyStuffed && (c) >= 0 && (c) < 256) \
+ c = langmap_mapchar[c]; \
+ } while (0)
+# endif
+#else
+# define LANGMAP_ADJUST(c, condition) /* nop */
#endif
/*