patch 9.1.1397: tabpanel not correctly updated on :tabonly

Commit: 
https://github.com/vim/vim/commit/2a1e253e266b62445e0087508109c41c41052a87
Author: Naruhiko Nishino <naru123456...@gmail.com>
Date:   Sat May 17 16:19:24 2025 +0200

    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 <naru123456...@gmail.com>
    Signed-off-by: Christian Brabandt <c...@256bit.org>

diff --git a/src/optionstr.c b/src/optionstr.c
index 7a1cd69e4..553b55f68 100644
--- a/src/optionstr.c
+++ b/src/optionstr.c
@@ -3561,8 +3561,6 @@ did_set_tabpanelopt(optset_T *args)
     if (tabpanelopt_changed() == FAIL)
        return e_invalid_argument;
 
-    shell_new_columns();
-
     return NULL;
 }
 
diff --git a/src/tabpanel.c b/src/tabpanel.c
index 0472e6b4b..fb5a957a3 100644
--- a/src/tabpanel.c
+++ b/src/tabpanel.c
@@ -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;
 }
 
diff --git a/src/testdir/dumps/Test_tabpanel_equalalways_0.dump 
b/src/testdir/dumps/Test_tabpanel_equalalways_0.dump
new file mode 100644
index 000000000..62a9b4016
--- /dev/null
+++ b/src/testdir/dumps/Test_tabpanel_equalalways_0.dump
@@ -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
diff --git a/src/testdir/dumps/Test_tabpanel_equalalways_1.dump 
b/src/testdir/dumps/Test_tabpanel_equalalways_1.dump
new file mode 100644
index 000000000..2ebcacee9
--- /dev/null
+++ b/src/testdir/dumps/Test_tabpanel_equalalways_1.dump
@@ -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
diff --git a/src/testdir/dumps/Test_tabpanel_equalalways_2.dump 
b/src/testdir/dumps/Test_tabpanel_equalalways_2.dump
new file mode 100644
index 000000000..baf823937
--- /dev/null
+++ b/src/testdir/dumps/Test_tabpanel_equalalways_2.dump
@@ -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
diff --git a/src/testdir/dumps/Test_tabpanel_equalalways_3.dump 
b/src/testdir/dumps/Test_tabpanel_equalalways_3.dump
new file mode 100644
index 000000000..c7f5f4ce7
--- /dev/null
+++ b/src/testdir/dumps/Test_tabpanel_equalalways_3.dump
@@ -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
diff --git a/src/testdir/test_tabpanel.vim b/src/testdir/test_tabpanel.vim
index cb3c42fed..c67166e1c 100644
--- a/src/testdir/test_tabpanel.vim
+++ b/src/testdir/test_tabpanel.vim
@@ -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
diff --git a/src/version.c b/src/version.c
index f282c1f32..6e5b00c54 100644
--- a/src/version.c
+++ b/src/version.c
@@ -709,6 +709,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1397,
 /**/
     1396,
 /**/

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/vim_dev/E1uGIYD-00GFwQ-Qf%40256bit.org.

Raspunde prin e-mail lui