mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-06-11 15:37:29 +02:00
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) <noreply@anthropic.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
b076c49282
commit
25e9fc44a8
+3
-3
@@ -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;
|
||||
|
||||
+12
@@ -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
|
||||
+12
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -734,6 +734,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
359,
|
||||
/**/
|
||||
358,
|
||||
/**/
|
||||
|
||||
Reference in New Issue
Block a user