fix(extui): search highlighting in extui "more" pager #33792

Problem:  No search highlighting in extui "more" pager window.
Solution: Only use custom highlight namespace in cmdline window.
This commit is contained in:
luukvbaal
2025-05-03 21:30:08 +02:00
committed by GitHub
parent d0867574bd
commit b2a5105c66
2 changed files with 6 additions and 1 deletions

View File

@@ -67,6 +67,9 @@ function M.enable(opts)
end
end)
-- Use MsgArea and hide search highlighting in the cmdline window.
-- TODO: Add new highlight group/namespaces for other windows? It is
-- clear MsgArea would be wanted in the box, more and prompt windows.
api.nvim_set_hl(ext.ns, 'Normal', { link = 'MsgArea' })
api.nvim_set_hl(ext.ns, 'Search', { link = 'MsgArea' })
api.nvim_set_hl(ext.ns, 'CurSearch', { link = 'MsgArea' })

View File

@@ -67,7 +67,9 @@ function M.tab_check_wins()
_cmdline_offset = type == 'cmd' and 0 or nil,
})
M.wins[M.tab][type] = api.nvim_open_win(M.bufs[type], false, cfg)
api.nvim_win_set_hl_ns(M.wins[M.tab][type], M.ns)
if type == 'cmd' then
api.nvim_win_set_hl_ns(M.wins[M.tab][type], M.ns)
end
setopt = true
elseif api.nvim_win_get_buf(M.wins[M.tab][type]) ~= M.bufs[type] then
api.nvim_win_set_buf(M.wins[M.tab][type], M.bufs[type])