diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2016-02-22 04:25:34 -0500 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2016-02-22 04:25:34 -0500 |
commit | e71de26abade27b1c7b7ff0cf45d393d71b9a028 (patch) | |
tree | 6bedd829ee9f073f7940a2ed09ad6829318d71b5 /src/nvim/edit.c | |
parent | 9403ce82bce1a2dcda4b01b10b2c01ee42bb4034 (diff) | |
parent | 99d4c8c29c4a9371c268cc20e4805709d86fb686 (diff) | |
download | rneovim-e71de26abade27b1c7b7ff0cf45d393d71b9a028.tar.gz rneovim-e71de26abade27b1c7b7ff0cf45d393d71b9a028.tar.bz2 rneovim-e71de26abade27b1c7b7ff0cf45d393d71b9a028.zip |
Merge pull request #4317 from justinmk/superkey
keymap: Support <D-...> (super/command key).
Diffstat (limited to 'src/nvim/edit.c')
-rw-r--r-- | src/nvim/edit.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/nvim/edit.c b/src/nvim/edit.c index d3b556f669..a983fa5772 100644 --- a/src/nvim/edit.c +++ b/src/nvim/edit.c @@ -4947,15 +4947,10 @@ int get_literal(void) return cc; } -/* - * Insert character, taking care of special keys and mod_mask - */ -static void -insert_special ( - int c, - int allow_modmask, - int ctrlv /* c was typed after CTRL-V */ -) +/// Insert character, taking care of special keys and mod_mask +/// +/// @param ctrlv `c` was typed after CTRL-V +static void insert_special(int c, int allow_modmask, int ctrlv) { char_u *p; int len; @@ -4967,6 +4962,9 @@ insert_special ( * Only use mod_mask for special keys, to avoid things like <S-Space>, * unless 'allow_modmask' is TRUE. */ + if (mod_mask & MOD_MASK_CMD) { // Command-key never produces a normal key. + allow_modmask = true; + } if (IS_SPECIAL(c) || (mod_mask && allow_modmask)) { p = get_special_key_name(c, mod_mask); len = (int)STRLEN(p); |