Skip to content

Commit

Permalink
feat: use vim.opt.winhighlight:append (#289)
Browse files Browse the repository at this point in the history
So as to not clobber other custom window highlights.

Co-authored-by: lbrayner <[email protected]>
  • Loading branch information
lbrayner and lbrayner authored Sep 10, 2023
1 parent 85b16ac commit 0ce9978
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lua/dapui/render/line_hover.lua
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,9 @@ function M.show()
window_id = api.nvim_open_win(hover_buf, false, win_opts)
buf_wins[buffer] = window_id

api.nvim_win_set_option(window_id, "winhighlight", "NormalFloat:Normal")
api.nvim_win_call(window_id, function()
vim.opt.winhighlight:append({ NormalFloat = "Normal" })
end)
end

orig_col = orig_col - 1 -- Working with 0-based index now
Expand Down
4 changes: 3 additions & 1 deletion lua/dapui/windows/layout.lua
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,9 @@ function WindowLayout:_init_win_settings(win)
for key, val in pairs(win_settings) do
api.nvim_win_set_option(win, key, val)
end
vim.fn.setwinvar(win, "&winhl", "Normal:DapUINormal,EndOfBuffer:DapUIEndOfBuffer")
api.nvim_win_call(win, function()
vim.opt.winhighlight:append({ Normal = "DapUINormal", EndOfBuffer = "DapUIEndOfBuffer" })
end)
end

function WindowLayout:new(layout)
Expand Down

0 comments on commit 0ce9978

Please sign in to comment.