mirror of
https://github.com/neovim/neovim.git
synced 2026-08-26 09:01:57 +00:00
fix(ruler): no window-local highlights for last line 'rulerformat'
Fixes #38777 in case 'rulerformat' is set.
See PR 38879. Original message:
Problem: When the 'ruler' is in the last line of the screen, it takes
local highlight definitions of the current window, tripping an
assert (since c1648cf).
Solution: Don't use window-local highlight definitions when the ruler is
not part of a statusline.
This commit is contained in:
@@ -348,7 +348,7 @@ static void win_redr_stl_expr(win_T *wp, bool draw_winbar, bool draw_ruler, bool
|
||||
opt_scope = ((*wp->w_p_stl != NUL) ? OPT_LOCAL : 0);
|
||||
}
|
||||
|
||||
attr = win_hl_attr(wp, (int)group);
|
||||
attr = draw_ruler && !in_status_line ? HL_ATTR(group) : win_hl_attr(wp, (int)group);
|
||||
if (!wp->w_floating && in_status_line && !is_stl_global) {
|
||||
col += wp->w_wincol;
|
||||
}
|
||||
|
||||
@@ -818,6 +818,15 @@ describe('statusline', function()
|
||||
{2:[No Name] 0,0-1 All}|
|
||||
0,0-1 All |
|
||||
]])
|
||||
command('set rulerformat=%17(%l,%c%V%=%P%)')
|
||||
screen:expect([[
|
||||
|
|
||||
{1:~}{15:^ }{1: }|
|
||||
{1:~ }|*4
|
||||
{2:[No Name] 0,0-1 All}|
|
||||
0,0-1 All |
|
||||
]])
|
||||
command('set rulerformat&')
|
||||
api.nvim_win_close(win, true)
|
||||
screen:expect([[
|
||||
^ |
|
||||
|
||||
Reference in New Issue
Block a user