diff options
author | Shougo Matsushita <Shougo.Matsu@gmail.com> | 2022-07-30 16:54:05 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-07-30 16:54:05 +0100 |
commit | f39cfb72629f3e7fefaf578a3faa2619cd0654f8 (patch) | |
tree | a990dd08ff44924fdfe2b915644fe49e4996ea99 /src/ex_getln.c | |
parent | d90f91fe3075bb51668ed926182b2163da9df001 (diff) | |
download | vim-git-f39cfb72629f3e7fefaf578a3faa2619cd0654f8.tar.gz |
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_getln.c')
-rw-r--r-- | src/ex_getln.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/ex_getln.c b/src/ex_getln.c index 2a1fe3dc6..58c83a85c 100644 --- a/src/ex_getln.c +++ b/src/ex_getln.c @@ -1611,6 +1611,15 @@ getcmdline_int( int did_save_ccline = FALSE; int cmdline_type; int wild_type; + int cmdheight0 = p_ch == 0; + + 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); + update_screen(VALID); // redraw the screen NOW + } // one recursion level deeper ++depth; @@ -2595,6 +2604,13 @@ theend: { char_u *p = ccline.cmdbuff; + if (cmdheight0) + { + set_option_value((char_u *)"ch", 0L, NULL, 0); + // Redraw is needed for command line completion + redraw_all_later(CLEAR); + } + --depth; if (did_save_ccline) restore_cmdline(&save_ccline); |