aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_cmds.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-06-02 03:48:36 +0800
committerGitHub <noreply@github.com>2022-06-02 03:48:36 +0800
commit57a296d899d170e7f78aec2225bf8ab2b0dc711c (patch)
tree082a19f7f7df82b489106af2620385b88887c092 /src/nvim/ex_cmds.c
parent209824ce2c6d37332079e6e213d4b8e257d7d53b (diff)
downloadrneovim-57a296d899d170e7f78aec2225bf8ab2b0dc711c.tar.gz
rneovim-57a296d899d170e7f78aec2225bf8ab2b0dc711c.tar.bz2
rneovim-57a296d899d170e7f78aec2225bf8ab2b0dc711c.zip
fix(inccommand): avoid crash if callback changes inccommand option (#18830)
clang: Result of operation is garbage or undefined clang: Uninitialized argument value Also check for == 's' instead of != 'n' as it is more straightforward. Also fix another unrelated PVS warning: PVS/V1071: Return value of win_comp_pos() is not always used
Diffstat (limited to 'src/nvim/ex_cmds.c')
-rw-r--r--src/nvim/ex_cmds.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c
index 7f75704de6..7e56f131ba 100644
--- a/src/nvim/ex_cmds.c
+++ b/src/nvim/ex_cmds.c
@@ -5872,7 +5872,7 @@ static int show_sub(exarg_T *eap, pos_T old_cusr, PreviewLines *preview_lines, i
linenr_T highest_num_line = 0;
int col_width = 0;
// Use preview window only when inccommand=split and range is not just the current line
- bool preview = (*p_icm != 'n') && (eap->line1 != old_cusr.lnum || eap->line2 != old_cusr.lnum);
+ bool preview = (*p_icm == 's') && (eap->line1 != old_cusr.lnum || eap->line2 != old_cusr.lnum);
if (preview) {
cmdpreview_buf = buflist_findnr(cmdpreview_bufnr);