aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/macros.h
diff options
context:
space:
mode:
authorDavid Bürgin <676c7473@gmail.com>2015-03-28 15:51:48 +0100
committerJustin M. Keyes <justinkz@gmail.com>2015-03-29 09:55:59 -0400
commit2c7e8c38e0f483cf803eb225720cd11ae370ae75 (patch)
tree7d4ab698d225a1a94e4afe36d40bf3792c64c455 /src/nvim/macros.h
parent9d02e5b984bb540567766941cff4d03f0b6e1837 (diff)
downloadrneovim-2c7e8c38e0f483cf803eb225720cd11ae370ae75.tar.gz
rneovim-2c7e8c38e0f483cf803eb225720cd11ae370ae75.tar.bz2
rneovim-2c7e8c38e0f483cf803eb225720cd11ae370ae75.zip
vim-patch:7.4.502 #2282
Problem: Language mapping also applies to mapped characters. Solution: Add the 'langnoremap' option, when on 'langmap' does not apply to mapped characters. (Christian Brabandt) https://github.com/vim/vim/releases/tag/v7-4-502
Diffstat (limited to 'src/nvim/macros.h')
-rw-r--r--src/nvim/macros.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/nvim/macros.h b/src/nvim/macros.h
index 60f6cd454f..93812683d6 100644
--- a/src/nvim/macros.h
+++ b/src/nvim/macros.h
@@ -77,12 +77,17 @@
* 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.
*/
# 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]; \