mirror of
https://github.com/neovim/neovim.git
synced 2025-10-01 23:48:32 +00:00
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.
This commit is contained in:

committed by
Justin M. Keyes

parent
28a6d4393d
commit
86c2adc074
@@ -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:
|
||||
|
Reference in New Issue
Block a user