aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/option.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-11-29 10:12:30 +0800
committerGitHub <noreply@github.com>2024-11-29 10:12:30 +0800
commitb1c907f21916dd3b16baeae9f68b1c3bcb3dcfd3 (patch)
treee48b53717c0658f60c9b66da1d60fdd8a88bd61c /src/nvim/option.c
parent1536f79d86b9edac1100e58ad5fbc421d14bfaa1 (diff)
downloadrneovim-b1c907f21916dd3b16baeae9f68b1c3bcb3dcfd3.tar.gz
rneovim-b1c907f21916dd3b16baeae9f68b1c3bcb3dcfd3.tar.bz2
rneovim-b1c907f21916dd3b16baeae9f68b1c3bcb3dcfd3.zip
vim-patch:9.1.0892: the max value of 'cmdheight' is limited by other tabpages (#31378)
Problem: the max value of 'cmdheight' is limited by other tabpages Solution: Limit the maximum value of 'cmdheight' to the current tabpage only. (Milly) The Help says that cmdheight is local to the tab page, but says nothing about the maximum value depending on the state of all tab pages. Users may wonder why they can't increase cmdheight when there are still rows available on the current tab page. This PR changes the behavior of cmdheight so that its maximum value depends only on the state of the current tab page. Also, since magic numbers were embedded in various places with the minimum value of cmdheight being 1, we defined a constant to make it easier to understand. closes: vim/vim#16131 https://github.com/vim/vim/commit/2cddf0e85a7f8304476397e1c51dcd0e41835ac3 Cherry-pick Test_cmdheight_not_changed() from patch 9.0.0187. Co-authored-by: Milly <milly.ca@gmail.com>
Diffstat (limited to 'src/nvim/option.c')
-rw-r--r--src/nvim/option.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/nvim/option.c b/src/nvim/option.c
index 27b80c0ac8..6da9635479 100644
--- a/src/nvim/option.c
+++ b/src/nvim/option.c
@@ -2764,10 +2764,11 @@ static const char *check_num_option_bounds(OptIndex opt_idx, OptInt *newval, cha
switch (opt_idx) {
case kOptLines:
- if (*newval < min_rows() && full_screen) {
- vim_snprintf(errbuf, errbuflen, _("E593: Need at least %d lines"), min_rows());
+ if (*newval < min_rows_for_all_tabpages() && full_screen) {
+ vim_snprintf(errbuf, errbuflen, _("E593: Need at least %d lines"),
+ min_rows_for_all_tabpages());
errmsg = errbuf;
- *newval = min_rows();
+ *newval = min_rows_for_all_tabpages();
}
// True max size is defined by check_screensize().
*newval = MIN(*newval, INT_MAX);