diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2026-04-21 08:27:26 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-04-21 08:27:26 +0800 |
| commit | 49d63ca5484da5ad35d6059b67ff1e526c164eeb (patch) | |
| tree | ef1a90d777498064e89f1315a6738f5e2c79d1c4 /src | |
| parent | 901b3f0c394a53961781ebeee682e64ad690a242 (diff) | |
vim-patch:9.2.0373: Ctrl-R mapping not triggered during completion (#39261)
Problem: Ctrl-R mapping not triggered during completion.
Solution: Move Ctrl-R check out of vim_is_ctrl_x_key()
(zeertzjq).
fixes: vim/vim#20004
closes: vim/vim#20006
https://github.com/vim/vim/commit/49e8630a2859e6ed497fb5702663c276f8ab6597
Diffstat (limited to 'src')
| -rw-r--r-- | src/nvim/insexpand.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/nvim/insexpand.c b/src/nvim/insexpand.c index 2be06a359b..3a309ae149 100644 --- a/src/nvim/insexpand.c +++ b/src/nvim/insexpand.c @@ -568,11 +568,6 @@ bool check_compl_option(bool dict_opt) bool vim_is_ctrl_x_key(int c) FUNC_ATTR_WARN_UNUSED_RESULT { - // Always allow ^R - let its results then be checked - if (c == Ctrl_R && ctrl_x_mode != CTRL_X_REGISTER) { - return true; - } - // Accept <PageUp> and <PageDown> if the popup menu is visible. if (ins_compl_pum_key(c)) { return true; @@ -2804,7 +2799,7 @@ bool ins_compl_prep(int c) retval = set_ctrl_x_mode(c); } else if (ctrl_x_mode_not_default()) { // We're already in CTRL-X mode, do we stay in it? - if (!vim_is_ctrl_x_key(c)) { + if (c != Ctrl_R && !vim_is_ctrl_x_key(c)) { ctrl_x_mode = ctrl_x_mode_scroll() ? CTRL_X_NORMAL : CTRL_X_FINISHED; edit_submode = NULL; } @@ -2834,7 +2829,7 @@ bool ins_compl_prep(int c) // reset continue_* if we left expansion-mode, if we stay they'll be // (re)set properly in ins_complete() - if (!vim_is_ctrl_x_key(c)) { + if (c != Ctrl_R && !vim_is_ctrl_x_key(c)) { compl_cont_status = 0; compl_cont_mode = 0; } |
