summaryrefslogtreecommitdiffstats
path: root/src/ex_cmds.c
diff options
context:
space:
mode:
authorShougo Matsushita <Shougo.Matsu@gmail.com>2022-07-30 16:54:05 +0100
committerBram Moolenaar <Bram@vim.org>2022-07-30 16:54:05 +0100
commitf39cfb72629f3e7fefaf578a3faa2619cd0654f8 (patch)
treea990dd08ff44924fdfe2b915644fe49e4996ea99 /src/ex_cmds.c
parentd90f91fe3075bb51668ed926182b2163da9df001 (diff)
patch 9.0.0114: the command line takes up space even when not usedv9.0.0114
Problem: The command line takes up space even when not used. Solution: Allow for 'cmdheight' to be set to zero. (Shougo Matsushita, closes #10675, closes #940)
Diffstat (limited to 'src/ex_cmds.c')
-rw-r--r--src/ex_cmds.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index 6e5e09fbf1..f41bc5f645 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -3704,6 +3704,7 @@ ex_substitute(exarg_T *eap)
int endcolumn = FALSE; // cursor in last column when done
pos_T old_cursor = curwin->w_cursor;
int start_nsubs;
+ int cmdheight0 = p_ch == 0;
#ifdef FEAT_EVAL
int save_ma = 0;
int save_sandbox = 0;
@@ -4010,6 +4011,14 @@ ex_substitute(exarg_T *eap)
}
}
+ if (cmdheight0)
+ {
+ // If cmdheight is 0, cmdheight must be set to 1 when we enter command
+ // line.
+ set_option_value((char_u *)"ch", 1L, NULL, 0);
+ redraw_statuslines();
+ }
+
/*
* Check for a match on each line.
*/
@@ -4833,6 +4842,10 @@ outofmem:
changed_window_setting();
#endif
+ // Restore cmdheight
+ if (cmdheight0)
+ set_option_value((char_u *)"ch", 0L, NULL, 0);
+
vim_regfree(regmatch.regprog);
vim_free(sub_copy);