aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_cmds.c
diff options
context:
space:
mode:
authorShougo <Shougo.Matsu@gmail.com>2022-07-01 10:59:50 +0900
committerGitHub <noreply@github.com>2022-06-30 18:59:50 -0700
commit5a490d838ed3288abcf45e16e6ab79c326a67c17 (patch)
treed6084fc7aec13c4324404bb0886ad907c8446ed3 /src/nvim/ex_cmds.c
parent3b1423bfa7adc5381af641a6e66fa2ca385ecab4 (diff)
downloadrneovim-5a490d838ed3288abcf45e16e6ab79c326a67c17.tar.gz
rneovim-5a490d838ed3288abcf45e16e6ab79c326a67c17.tar.bz2
rneovim-5a490d838ed3288abcf45e16e6ab79c326a67c17.zip
cmdheight=0: fix bugs #18961
Continue of #16251 Fix #18953 Fix #18960 Fix #18958 Fix #18955 Fix #18970 Fix #18983 Fix #18995 Fix #19112
Diffstat (limited to 'src/nvim/ex_cmds.c')
-rw-r--r--src/nvim/ex_cmds.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c
index 45d08d40bc..82422a78c3 100644
--- a/src/nvim/ex_cmds.c
+++ b/src/nvim/ex_cmds.c
@@ -3651,6 +3651,13 @@ static int do_sub(exarg_T *eap, proftime_T timeout, long cmdpreview_ns, handle_T
sub_needs_free = cmdpreview && sub != source;
}
+ bool cmdheight0 = p_ch < 1 && !ui_has(kUIMessages);
+ if (cmdheight0) {
+ // If cmdheight is 0, cmdheight must be set to 1 when we enter command line.
+ set_option_value("ch", 1L, NULL, 0);
+ redraw_statuslines();
+ }
+
// Check for a match on each line.
// If preview: limit to max('cmdwinheight', viewport).
linenr_T line2 = eap->line2;
@@ -4461,6 +4468,11 @@ skip:
}
}
+ if (cmdheight0) {
+ // Restore cmdheight
+ set_option_value("ch", 0L, NULL, 0);
+ }
+
kv_destroy(preview_lines.subresults);
return retv;
#undef ADJUST_SUB_FIRSTLNUM