From: Hirohito Higashi Date: Thu, 16 Apr 2026 20:12:08 +0000 (+0000) Subject: patch 9.2.0359: wrong VertSplitNC highlighting on winbar X-Git-Tag: v9.2.0359^0 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=25e9fc44a87792a7de9a1f158ce23295480ef5e8;p=thirdparty%2Fvim.git patch 9.2.0359: wrong VertSplitNC highlighting on winbar Problem: wrong VertSplitNC highlighting on winbar (Maxim Kim, after v9.2.0349) Solution: Use VertSplit instead of VertSplitNC for winbar rows (Hirohito Higashi). vsep_row_is_curwin() and right_neighbor_at_row() used W_WINROW() which excludes winbar rows from the window's range. This caused the vertical separator at winbar rows to use VertSplitNC even when curwin is adjacent. Use w_winrow directly so winbar rows are included in the range check. fixes: #19985 closes: #19987 Co-Authored-By: Claude Opus 4.6 (1M context) Signed-off-by: Hirohito Higashi Signed-off-by: Christian Brabandt --- diff --git a/src/screen.c b/src/screen.c index 8005b3cc33..eb7cc9cdd1 100644 --- a/src/screen.c +++ b/src/screen.c @@ -5129,9 +5129,9 @@ vsep_row_is_curwin(win_T *wp, int row) return true; // Check if curwin is immediately to the right of wp's separator and - // "row" is within curwin's row range. + // "row" is within curwin's row range (including the winbar). if (curwin->w_wincol == W_ENDCOL(wp) + wp->w_vsep_width - && row >= W_WINROW(curwin) + && row >= curwin->w_winrow && row < W_WINROW(curwin) + curwin->w_height) return true; @@ -5173,7 +5173,7 @@ right_neighbor_at_row(win_T *wp, int row) FOR_ALL_WINDOWS(rn) if (rn->w_wincol == rcol - && row >= W_WINROW(rn) + && row >= rn->w_winrow && row < W_WINROW(rn) + rn->w_height + rn->w_status_height) return rn; return NULL; diff --git a/src/testdir/dumps/Test_VertSplitNC_winbar_1.dump b/src/testdir/dumps/Test_VertSplitNC_winbar_1.dump new file mode 100644 index 0000000000..4fbee462da --- /dev/null +++ b/src/testdir/dumps/Test_VertSplitNC_winbar_1.dump @@ -0,0 +1,12 @@ +|w+0&#ffffff0|i|n|b|a|r| |t|e|s|t| @25||+0#40ff4011&| +0#0000000#e0e0e08| +2#ffffff16#6c6c6c255|I|t|e|m| | +0#0000000#e0e0e08@29 +|w+0&#ffffff0|i|n|b|a|r| |t|e|s|t| @25||+0#40ff4011&>w+0#0000000&|i|n|b|a|r| |t|e|s|t| @25 +|w|i|n|b|a|r| |t|e|s|t| @25||+0#40ff4011&|w+0#0000000&|i|n|b|a|r| |t|e|s|t| @25 +|w|i|n|b|a|r| |t|e|s|t| @25||+0#40ff4011&|w+0#0000000&|i|n|b|a|r| |t|e|s|t| @25 +|w|i|n|b|a|r| |t|e|s|t| @25||+0#40ff4011&|w+0#0000000&|i|n|b|a|r| |t|e|s|t| @25 +|w|i|n|b|a|r| |t|e|s|t| @25||+0#40ff4011&|w+0#0000000&|i|n|b|a|r| |t|e|s|t| @25 +|w|i|n|b|a|r| |t|e|s|t| @25||+0#40ff4011&|w+0#0000000&|i|n|b|a|r| |t|e|s|t| @25 +|w|i|n|b|a|r| |t|e|s|t| @25||+0#40ff4011&|w+0#0000000&|i|n|b|a|r| |t|e|s|t| @25 +|w|i|n|b|a|r| |t|e|s|t| @25||+0#40ff4011&|w+0#0000000&|i|n|b|a|r| |t|e|s|t| @25 +|w|i|n|b|a|r| |t|e|s|t| @25||+0#40ff4011&|w+0#0000000&|i|n|b|a|r| |t|e|s|t| @25 +|[+0#0000001#a8a8a8255|N|o| |N|a|m|e|]| |[|+|]| @5|1|,|1| @11|T|o|p| +0#ffffff16#0000e05|[|N|o| |N|a|m|e|]| |[|+|]| @5|1|,|1| @11|T|o|p +| +0#0000000#ffffff0@74 diff --git a/src/testdir/dumps/Test_VertSplitNC_winbar_2.dump b/src/testdir/dumps/Test_VertSplitNC_winbar_2.dump new file mode 100644 index 0000000000..765328356e --- /dev/null +++ b/src/testdir/dumps/Test_VertSplitNC_winbar_2.dump @@ -0,0 +1,12 @@ +>w+0&#ffffff0|i|n|b|a|r| |t|e|s|t| @25||+0#40ff4011&| +0#0000000#e0e0e08| +2#ffffff16#6c6c6c255|I|t|e|m| | +0#0000000#e0e0e08@29 +|w+0&#ffffff0|i|n|b|a|r| |t|e|s|t| @25||+0#40ff4011&|w+0#0000000&|i|n|b|a|r| |t|e|s|t| @25 +|w|i|n|b|a|r| |t|e|s|t| @25||+0#40ff4011&|w+0#0000000&|i|n|b|a|r| |t|e|s|t| @25 +|w|i|n|b|a|r| |t|e|s|t| @25||+0#40ff4011&|w+0#0000000&|i|n|b|a|r| |t|e|s|t| @25 +|w|i|n|b|a|r| |t|e|s|t| @25||+0#40ff4011&|w+0#0000000&|i|n|b|a|r| |t|e|s|t| @25 +|w|i|n|b|a|r| |t|e|s|t| @25||+0#40ff4011&|w+0#0000000&|i|n|b|a|r| |t|e|s|t| @25 +|w|i|n|b|a|r| |t|e|s|t| @25||+0#40ff4011&|w+0#0000000&|i|n|b|a|r| |t|e|s|t| @25 +|w|i|n|b|a|r| |t|e|s|t| @25||+0#40ff4011&|w+0#0000000&|i|n|b|a|r| |t|e|s|t| @25 +|w|i|n|b|a|r| |t|e|s|t| @25||+0#40ff4011&|w+0#0000000&|i|n|b|a|r| |t|e|s|t| @25 +|w|i|n|b|a|r| |t|e|s|t| @25||+0#40ff4011&|w+0#0000000&|i|n|b|a|r| |t|e|s|t| @25 +|[+0#ffffff16#0000e05|N|o| |N|a|m|e|]| |[|+|]| @5|1|,|1| @11|T|o|p| |[+0#0000001#a8a8a8255|N|o| |N|a|m|e|]| |[|+|]| @5|1|,|1| @11|T|o|p +| +0#0000000#ffffff0@74 diff --git a/src/testdir/test_highlight.vim b/src/testdir/test_highlight.vim index 6968e72b6a..ef593b8b35 100644 --- a/src/testdir/test_highlight.vim +++ b/src/testdir/test_highlight.vim @@ -1812,4 +1812,36 @@ func Test_VertSplitNC_winhighlight() call StopVimInTerminal(buf) endfunc +" Test that VertSplit (not VertSplitNC) is used for the separator rows +" adjacent to a window with a winbar. +func Test_VertSplitNC_winbar() + CheckScreendump + + let lines =<< trim END + hi StatusLine ctermfg=White ctermbg=DarkBlue cterm=NONE + hi StatusLineNC ctermfg=Black ctermbg=Gray cterm=NONE + hi VertSplit ctermfg=Green ctermbg=NONE cterm=NONE + hi VertSplitNC ctermfg=DarkGray ctermbg=NONE cterm=NONE + call setline(1, repeat(['winbar test'], 20)) + vsplit + wincmd w + nnoremenu 1.10 WinBar.Item :echo 'test' + END + call writefile(lines, 'Xtest_vertsplitNC_winbar', 'D') + + let buf = RunVimInTerminal('-S Xtest_vertsplitNC_winbar', {'rows': 12}) + call TermWait(buf) + + " Right window (with winbar) is current: the separator should use + " VertSplit for all rows including the winbar row. + call VerifyScreenDump(buf, 'Test_VertSplitNC_winbar_1', {}) + + " Move to left window: the separator should use VertSplitNC. + call term_sendkeys(buf, "\h") + call TermWait(buf) + call VerifyScreenDump(buf, 'Test_VertSplitNC_winbar_2', {}) + + call StopVimInTerminal(buf) +endfunc + " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/version.c b/src/version.c index a836743b7a..b015465ed5 100644 --- a/src/version.c +++ b/src/version.c @@ -734,6 +734,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 359, /**/ 358, /**/