diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-07-17 10:15:45 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-17 10:15:45 +0800 |
commit | b60a2ab4cb7bb7d86dcda1dfe2396a9eda384e35 (patch) | |
tree | fd84f00d239eb9f8227e359b898081465dccfdd7 /src | |
parent | f660b794808ac809ee8cafe82ddd824840bc8e2c (diff) | |
download | rneovim-b60a2ab4cb7bb7d86dcda1dfe2396a9eda384e35.tar.gz rneovim-b60a2ab4cb7bb7d86dcda1dfe2396a9eda384e35.tar.bz2 rneovim-b60a2ab4cb7bb7d86dcda1dfe2396a9eda384e35.zip |
fix(inccommand): block errors when parsing command line again (#24374)
Revert the change to ex_getln.c from a741c7fd0465c949a0016fcbee5f4526b65f8c02
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/ex_getln.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c index 6bb980d501..927877dc74 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -261,6 +261,7 @@ static bool do_incsearch_highlighting(int firstc, int *search_delim, incsearch_s return false; } + emsg_off++; exarg_T ea = { .line1 = 1, .line2 = 1, @@ -368,6 +369,7 @@ static bool do_incsearch_highlighting(int firstc, int *search_delim, incsearch_s curwin->w_cursor = save_cursor; retval = true; theend: + emsg_off--; return retval; } @@ -2427,9 +2429,12 @@ static bool cmdpreview_may_show(CommandLineState *s) int cmdpreview_type = 0; char *cmdline = xstrdup(ccline.cmdbuff); const char *errormsg = NULL; + emsg_off++; // Block errors when parsing the command line, and don't update v:errmsg if (!parse_cmdline(cmdline, &ea, &cmdinfo, &errormsg)) { + emsg_off--; goto end; } + emsg_off--; // Check if command is previewable, if not, don't attempt to show preview if (!(ea.argt & EX_PREVIEW)) { |