patch 9.2.0359: wrong VertSplitNC highlighting on winbar

Commit: 
https://github.com/vim/vim/commit/25e9fc44a87792a7de9a1f158ce23295480ef5e8
Author: Hirohito Higashi <[email protected]>
Date:   Thu Apr 16 20:12:08 2026 +0000

    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) <[email protected]>
    Signed-off-by: Hirohito Higashi <[email protected]>
    Signed-off-by: Christian Brabandt <[email protected]>

diff --git a/src/screen.c b/src/screen.c
index 8005b3cc3..eb7cc9cdd 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 000000000..4fbee462d
--- /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 000000000..765328356
--- /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 6968e72b6..ef593b8b3 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'<CR>
+  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, "\<C-W>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 a836743b7..b015465ed 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,
 /**/

-- 
-- 
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 [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/vim_dev/E1wDTLf-006CeU-Si%40256bit.org.

Raspunde prin e-mail lui