int content_end = W_WINROW(wp) + wp->w_height;
- // Content rows: VertSplit/VertSplitNC based on adjacency.
- for (int r = W_WINROW(wp) + row; r < content_end; ++r)
+ // Content rows: VertSplit/VertSplitNC based on adjacency. Include the
+ // WinBar row (above the content) when redrawing from the top so that
+ // the separator highlight is updated on current-window changes.
+ int start_row = (row == 0) ? wp->w_winrow : W_WINROW(wp) + row;
+ for (int r = start_row; r < content_end; ++r)
{
int hl;
int c = fillchar_vsep(&hl, wp, r);
--- /dev/null
+| +0&#ffffff0@19||+0#000000255&| +0#0000000&@18||+0#000000255&| +0#0000000&@18
+|~+0#4040ff13&| @18||+0#000000255&|~+0#4040ff13&| @17||+0#000000255&|~+0#4040ff13&| @17
+|~| @18||+0#000000255&|~+0#4040ff13&| @17||+0#000000255&|~+0#4040ff13&| @17
+|~| @18||+0#000000255&|~+0#4040ff13&| @17||+0#000000255&|~+0#4040ff13&| @17
+|~| @18||+0#000000255&|~+0#4040ff13&| @17||+0#000000255&|~+0#4040ff13&| @17
+|~| @18||+0#000000255&|~+0#4040ff13&| @17||+0#000000255&|~+0#4040ff13&| @17
+|~| @18||+0#000000255&|~+0#4040ff13&| @17||+0#000000255&|~+0#4040ff13&| @17
+|~| @18||+0#000000255&|~+0#4040ff13&| @17||+0#000000255&|~+0#4040ff13&| @17
+|~| @18||+0#000000255&|~+0#4040ff13&| @17||+0#000000255&|~+0#4040ff13&| @17
+|<+1#0000000&|N|o| |N|a|m|e|]| |0|,|0|-|1| @1|A|l@1| |<|N|o| |N|a|m|e|]| |0|,|0|-|1| |A|l@1| |<|N|o| |N|a|m|e|]| |0|,|0|-|1| |A|l@1
+| +0&#e0e0e08| +2#ffffff16#6c6c6c255|S|t|e|p| | +0#0000000#e0e0e08@1| +2#ffffff16#6c6c6c255|N|e|x|t| | +0#0000000#e0e0e08@1| +2#ffffff16#6c6c6c255|F|i|n|i|s|h| | +0#0000000#e0e0e08@1| +2#ffffff16#6c6c6c255|C|o||+1#87afff255#ffffff0| +0#0000000&@28
+> @29||+1#87afff255&|~+0#4040ff13&| @27
+|~| @28||+1#87afff255&|~+0#4040ff13&| @27
+|~| @28||+1#87afff255&|~+0#4040ff13&| @27
+|~| @28||+1#87afff255&|~+0#4040ff13&| @27
+|~| @28||+1#87afff255&|~+0#4040ff13&| @27
+|~| @28||+1#87afff255&|~+0#4040ff13&| @27
+|~| @28||+1#87afff255&|~+0#4040ff13&| @27
+|[+3#0000000&|N|o| |N|a|m|e|]| @5|0|,|0|-|1| @6|A|l@1| |[+1&&|N|o| |N|a|m|e|]| @5|0|,|0|-|1| @5|A|l@1
+| +0&&@59
--- /dev/null
+> +0&#ffffff0@19||+1#87afff255&| +0#0000000&@18||+0#000000255&| +0#0000000&@18
+|~+0#4040ff13&| @18||+1#87afff255&|~+0#4040ff13&| @17||+0#000000255&|~+0#4040ff13&| @17
+|~| @18||+1#87afff255&|~+0#4040ff13&| @17||+0#000000255&|~+0#4040ff13&| @17
+|~| @18||+1#87afff255&|~+0#4040ff13&| @17||+0#000000255&|~+0#4040ff13&| @17
+|~| @18||+1#87afff255&|~+0#4040ff13&| @17||+0#000000255&|~+0#4040ff13&| @17
+|~| @18||+1#87afff255&|~+0#4040ff13&| @17||+0#000000255&|~+0#4040ff13&| @17
+|~| @18||+1#87afff255&|~+0#4040ff13&| @17||+0#000000255&|~+0#4040ff13&| @17
+|~| @18||+1#87afff255&|~+0#4040ff13&| @17||+0#000000255&|~+0#4040ff13&| @17
+|~| @18||+1#87afff255&|~+0#4040ff13&| @17||+0#000000255&|~+0#4040ff13&| @17
+|<+3#0000000&|N|o| |N|a|m|e|]| |0|,|0|-|1| @1|A|l@1| |<+1&&|N|o| |N|a|m|e|]| |0|,|0|-|1| |A|l@1| |<|N|o| |N|a|m|e|]| |0|,|0|-|1| |A|l@1
+| +0&#e0e0e08| +2#ffffff16#6c6c6c255|S|t|e|p| | +0#0000000#e0e0e08@1| +2#ffffff16#6c6c6c255|N|e|x|t| | +0#0000000#e0e0e08@1| +2#ffffff16#6c6c6c255|F|i|n|i|s|h| | +0#0000000#e0e0e08@1| +2#ffffff16#6c6c6c255|C|o||+0#000000255#ffffff0| +0#0000000&@28
+@30||+0#000000255&|~+0#4040ff13&| @27
+|~| @28||+0#000000255&|~+0#4040ff13&| @27
+|~| @28||+0#000000255&|~+0#4040ff13&| @27
+|~| @28||+0#000000255&|~+0#4040ff13&| @27
+|~| @28||+0#000000255&|~+0#4040ff13&| @27
+|~| @28||+0#000000255&|~+0#4040ff13&| @27
+|~| @28||+0#000000255&|~+0#4040ff13&| @27
+|[+1#0000000&|N|o| |N|a|m|e|]| @5|0|,|0|-|1| @6|A|l@1| |[|N|o| |N|a|m|e|]| @5|0|,|0|-|1| @5|A|l@1
+| +0&&@59
call StopVimInTerminal(buf)
endfunction
+" The vertical separator on the WinBar row must follow VertSplit/VertSplitNC
+" when the current window changes.
+func Test_winbar_vsep_highlight_after_focus_change()
+ CheckScreendump
+
+ let lines =<< trim END
+ vim9script
+ wincmd s
+ wincmd v
+ wincmd v
+ wincmd j
+ wincmd v
+ nnoremenu 1.10 WinBar.Step :Step<CR>
+ nnoremenu 1.20 WinBar.Next :Next<CR>
+ nnoremenu 1.30 WinBar.Finish :Finish<CR>
+ nnoremenu 1.40 WinBar.Cont :Continue<CR>
+ hi Vertsplit term=reverse ctermfg=111
+ hi VertsplitNC term=reverse ctermfg=16
+ END
+ call writefile(lines, 'XtestWinbarVsep', 'D')
+ let buf = RunVimInTerminal('-S XtestWinbarVsep', #{rows: 20, cols: 60})
+
+ call VerifyScreenDump(buf, 'Test_winbar_vsep_active', {})
+
+ call term_sendkeys(buf, "\<C-W>k")
+ call VerifyScreenDump(buf, 'Test_winbar_vsep_inactive', {})
+
+ call StopVimInTerminal(buf)
+endfunc
+
func Test_drag_statusline_with_winbar()
call SetupWinbar()
let save_mouse = &mouse
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 530,
/**/
529,
/**/