aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_getln.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-02-11 19:01:43 +0800
committerzeertzjq <zeertzjq@outlook.com>2023-02-11 19:04:28 +0800
commitf1fcdcc2c43839b037517d1dd7b1a4570eb970a8 (patch)
tree80f6093861b080847287a6a8c94c5007926f412c /src/nvim/ex_getln.c
parent9437800d280385c018a99aa0fbe9043e4d7715aa (diff)
downloadrneovim-f1fcdcc2c43839b037517d1dd7b1a4570eb970a8.tar.gz
rneovim-f1fcdcc2c43839b037517d1dd7b1a4570eb970a8.tar.bz2
rneovim-f1fcdcc2c43839b037517d1dd7b1a4570eb970a8.zip
vim-patch:9.0.1299: change for triggering incsearch not sufficiently tested
Problem: Change for triggering incsearch not sufficiently tested. Solution: Add a test case. Simplify the code. (closes vim/vim#11971) https://github.com/vim/vim/commit/412e0e4ed903682f352d8ea58ded480930cc664f
Diffstat (limited to 'src/nvim/ex_getln.c')
-rw-r--r--src/nvim/ex_getln.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c
index d55da46227..af26fe8a1c 100644
--- a/src/nvim/ex_getln.c
+++ b/src/nvim/ex_getln.c
@@ -1626,9 +1626,9 @@ static int command_line_insert_reg(CommandLineState *s)
ccline.special_char = NUL;
redrawcmd();
- // The text has been stuffed, the command line didn't change yet, but it
- // will change soon. The caller must take care of it.
- return literally ? CMDLINE_NOT_CHANGED : CMDLINE_CHANGED;
+ // With "literally": the command line has already changed.
+ // Else: the text has been stuffed, but the command line didn't change yet.
+ return literally ? CMDLINE_CHANGED : CMDLINE_NOT_CHANGED;
}
/// Handle the Left and Right mouse clicks in the command-line mode.
@@ -1862,9 +1862,8 @@ static int command_line_handle_key(CommandLineState *s)
switch (command_line_insert_reg(s)) {
case GOTO_NORMAL_MODE:
return 0; // back to cmd mode
- case CMDLINE_NOT_CHANGED:
- s->is_state.incsearch_postponed = true;
- FALLTHROUGH;
+ case CMDLINE_CHANGED:
+ return command_line_changed(s);
default:
return command_line_not_changed(s);
}