patch 9.1.1397: tabpanel not correctly updated on :tabonly

Problem:  tabpanel not correctly updated on :tabonly
          (Maxim Kim)
Solution: force a redraw, take 'equalalways' into account
          (Naruhiko Nishino)

related: https://github.com/vim/vim/pull/17330#issuecomment-2888146370
closes: #17337

Signed-off-by: Naruhiko Nishino <naru123456789@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Naruhiko Nishino
2025-05-17 16:19:24 +02:00
committed by Christian Brabandt
parent 7b9eb6389d
commit 2a1e253e26
8 changed files with 78 additions and 2 deletions

View File

@ -3561,8 +3561,6 @@ did_set_tabpanelopt(optset_T *args)
if (tabpanelopt_changed() == FAIL)
return e_invalid_argument;
shell_new_columns();
return NULL;
}

View File

@ -59,6 +59,7 @@ tabpanelopt_changed(void)
int new_align = ALIGN_LEFT;
int new_columns = 20;
int new_is_vert = FALSE;
int do_equal = 0;
p = p_tplo;
while (*p != NUL)
@ -90,10 +91,20 @@ tabpanelopt_changed(void)
++p;
}
// Whether all the windows are automatically made the same size
// when tabpanel size is changed.
do_equal = p_ea && tpl_columns != new_columns;
tpl_align = new_align;
tpl_columns = new_columns;
tpl_is_vert = new_is_vert;
shell_new_columns();
redraw_tabpanel = TRUE;
if (do_equal)
win_equal(curwin, FALSE, 0);
return OK;
}

View File

@ -0,0 +1,10 @@
|[+8#0000001#e0e0e08|N|o| |N|a|m|e|]| @11|[|N|o| |N|a|m|e|]| | +2#0000000#ffffff0|3+2#e000e06&| +2#0000000&|[|N|o| |N|a|m|e|]| | +1&&@32|X+8#0000001#e0e0e08
|3+2#e000e06#ffffff0| +2#0000000&|[|N|o| |N|a|m|e|]| @8> +0&&@28||+1&&| +0&&@27
| +1&&@19|~+0#4040ff13&| @27||+1#0000000&|~+0#4040ff13&| @26
| +1#0000000&@19|~+0#4040ff13&| @27||+1#0000000&|~+0#4040ff13&| @26
| +1#0000000&@19|[+3&&|N|o| |N|a|m|e|]| @5|0|,|0|-|1| @5|A|l@1| |[+1&&|N|o| |N|a|m|e|]| @4|0|,|0|-|1| @5|A|l@1
| @19| +0&&@57
| +1&&@19|~+0#4040ff13&| @56
| +1#0000000&@19|~+0#4040ff13&| @56
| +1#0000000&@19|[|N|o| |N|a|m|e|]| @30|0|,|0|-|1| @9|A|l@1
| +0&&@77

View File

@ -0,0 +1,10 @@
|[+8#0000001#e0e0e08|N|o| |N|a|m|e|]| @1|[|N|o| |N|a|m|e|]| | +2#0000000#ffffff0|3+2#e000e06&| +2#0000000&|[|N|o| |N|a|m|e|]| | +1&&@42|X+8#0000001#e0e0e08
|3+2#e000e06#ffffff0| +2#0000000&|[|N|o| |N|a|m|e> +0&&@33||+1&&| +0&&@32
| +1&&@9|~+0#4040ff13&| @32||+1#0000000&|~+0#4040ff13&| @31
| +1#0000000&@9|~+0#4040ff13&| @32||+1#0000000&|~+0#4040ff13&| @31
| +1#0000000&@9|[+3&&|N|o| |N|a|m|e|]| @7|0|,|0|-|1| @8|A|l@1| |[+1&&|N|o| |N|a|m|e|]| @7|0|,|0|-|1| @7|A|l@1
| @9| +0&&@67
| +1&&@9|~+0#4040ff13&| @66
| +1#0000000&@9|~+0#4040ff13&| @66
| +1#0000000&@9|[|N|o| |N|a|m|e|]| @40|0|,|0|-|1| @9|A|l@1
|:+0&&|s|e|t| |t|a|b|p|a|n|e|l|o|p|t|=|c|o|l|u|m|n|s|:|1|0| @50

View File

@ -0,0 +1,10 @@
|[+8#0000001#e0e0e08|N|o| |N|a|m|e|]| @21|[|N|o| |N|a|m|e|]| | +2#0000000#ffffff0|3+2#e000e06&| +2#0000000&|[|N|o| |N|a|m|e|]| | +1&&@22|X+8#0000001#e0e0e08
|3+2#e000e06#ffffff0| +2#0000000&|[|N|o| |N|a|m|e|]| @18> +0&&@23||+1&&| +0&&@22
| +1&&@29|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @21
| +1#0000000&@29|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @21
| +1#0000000&@29|[+3&&|N|o| |N|a|m|e|]| @2|0|,|0|-|1| @3|A|l@1| |[+1&&|N|o| |N|a|m|e|]| @2|0|,|0|-|1| @2|A|l@1
| @29| +0&&@47
| +1&&@29|~+0#4040ff13&| @46
| +1#0000000&@29|~+0#4040ff13&| @46
| +1#0000000&@29|[|N|o| |N|a|m|e|]| @20|0|,|0|-|1| @9|A|l@1
|:+0&&|s|e|t| |t|a|b|p|a|n|e|l|o|p|t|=|c|o|l|u|m|n|s|:|3|0| @50

View File

@ -0,0 +1,10 @@
|[+8#0000001#e0e0e08|N|o| |N| |[|N|o| |N|a|m|e|]| | +2#0000000#ffffff0|3+2#e000e06&| +2#0000000&|[|N|o| |N|a|m|e|]| | +1&&@47|X+8#0000001#e0e0e08
|3+2#e000e06#ffffff0| +2#0000000&|[|N|o> +0&&@35||+1&&| +0&&@35
| +1&&@4|~+0#4040ff13&| @34||+1#0000000&|~+0#4040ff13&| @34
| +1#0000000&@4|~+0#4040ff13&| @34||+1#0000000&|~+0#4040ff13&| @34
| +1#0000000&@4|[+3&&|N|o| |N|a|m|e|]| @8|0|,|0|-|1| @9|A|l@1| |[+1&&|N|o| |N|a|m|e|]| @8|0|,|0|-|1| @9|A|l@1
| @4| +0&&@72
| +1&&@4|~+0#4040ff13&| @71
| +1#0000000&@4|~+0#4040ff13&| @71
| +1#0000000&@4|[|N|o| |N|a|m|e|]| @45|0|,|0|-|1| @9|A|l@1
|:+0&&|s|e|t| |t|a|b|p|a|n|e|l|o|p|t|=|c|o|l|u|m|n|s|:|5| @51

View File

@ -496,4 +496,29 @@ function Test_tabpanel_tabonly()
call StopVimInTerminal(buf)
endfunc
function Test_tabpanel_equalalways()
CheckScreendump
let lines =<< trim END
tabnew
set showtabpanel=1
set tabpanelopt=columns:20
set equalalways
split
vsplit
END
call writefile(lines, 'XTest_tabpanel_equalalways', 'D')
let buf = RunVimInTerminal('-S XTest_tabpanel_equalalways', {'rows': 10, 'cols': 78})
call VerifyScreenDump(buf, 'Test_tabpanel_equalalways_0', {})
call term_sendkeys(buf, ":set tabpanelopt=columns:10\<CR>")
call VerifyScreenDump(buf, 'Test_tabpanel_equalalways_1', {})
call term_sendkeys(buf, ":set tabpanelopt=columns:30\<CR>")
call VerifyScreenDump(buf, 'Test_tabpanel_equalalways_2', {})
call term_sendkeys(buf, ":set tabpanelopt=columns:5\<CR>")
call VerifyScreenDump(buf, 'Test_tabpanel_equalalways_3', {})
call StopVimInTerminal(buf)
endfunc
" vim: shiftwidth=2 sts=2 expandtab

View File

@ -709,6 +709,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1397,
/**/
1396,
/**/