diff options
author | Matthew Malcomson <hardenedapple@gmail.com> | 2017-02-10 15:58:45 +0000 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2017-02-28 01:16:18 +0100 |
commit | 86c2adc07463e37a60801e8fd0572402a5d27262 (patch) | |
tree | ebf60508f1cf4eb1fbd68c941d907f6bfde10ef8 /src | |
parent | 28a6d4393db0de56ade7e75d0029f6bbd8f2e9db (diff) | |
download | rneovim-86c2adc07463e37a60801e8fd0572402a5d27262.tar.gz rneovim-86c2adc07463e37a60801e8fd0572402a5d27262.tar.bz2 rneovim-86c2adc07463e37a60801e8fd0572402a5d27262.zip |
edit.c: CTRL-SPC: Insert previously-inserted text. #6090
Default Vim behavior of i_CTRL-<Space> is to insert the last-inserted
text and exit insert mode. :help i_CTRL-@
Before this commit that did not happen because insert_handle_key()
checks for NUL instead of checking for ' ' with a CTRL `mod_mask`.
I'm leaving the check for NUL despite the fact that at the moment that
key is never seen when using the terminal UI (not for C-Space, nor C-@).
This is because I assume it's still allowed for other front-ends to pass
NUL, but at the moment the terminal UI isn't.
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/edit.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/nvim/edit.c b/src/nvim/edit.c index ecc794fb14..0de8177467 100644 --- a/src/nvim/edit.c +++ b/src/nvim/edit.c @@ -844,6 +844,11 @@ static int insert_handle_key(InsertState *s) return 0; // exit insert mode + case ' ': + if (mod_mask != 4) { + goto normalchar; + } + // FALLTHROUGH case K_ZERO: // Insert the previously inserted text. case NUL: case Ctrl_A: |