feat: Jump highlight customizations

Closes #27

- Highlight group 'OutlineJumpHighlight' (links to Visual by default)
- Config: outline_window.jump_highlight_duration (integer for
  milliseconds, or boolean to enable/disable)
This commit is contained in:
hedy
2023-11-16 22:14:47 +08:00
parent fdc7c6391f
commit 134b7e2f39
4 changed files with 30 additions and 3 deletions

View File

@@ -105,7 +105,17 @@ function M.__goto_location(change_focus)
M.state.code_win,
{ node.line + 1, node.character }
)
utils.flash_highlight(M.state.code_win, node.line + 1, true)
if vim.fn.hlexists('OutlineJumpHighlight') == 0 then
vim.api.nvim_set_hl(0, 'OutlineJumpHighlight', { link = 'Visual' })
end
utils.flash_highlight(
M.state.code_win,
node.line + 1,
cfg.o.outline_window.jump_highlight_duration,
'OutlineJumpHighlight'
)
if change_focus then
vim.fn.win_gotoid(M.state.code_win)
end