feat: make hl_mode of hints configurable (#72)

* feat: add hl_mode to change highlight of hint char

* chore: fix typo in docs

---------

Co-authored-by: mohsen <smoka7@hotmail.com>
This commit is contained in:
Henry Hsieh
2024-04-26 01:12:09 +08:00
committed by GitHub
parent 059e88e9dc
commit 6ff23501a1
3 changed files with 11 additions and 1 deletions

View File

@@ -874,6 +874,15 @@ below.
Defaults:~
`dim_unmatched = true`
`hl_mode` *hop-config-hl_mode*
Highlight mode of the hint chars. Set this option to `combine` will
preserve the background colors of original chars. Set this option to
`replace` will remove the background colors of original chars. It's useful
when the hint chars is not clear on search highlights.
Defaults:~
`hl_mode = "combine"`
`direction` *hop-config-direction*
Direction in which to hint. See |hop.hint.HintDirection| for further
details.

View File

@@ -18,6 +18,7 @@ M.case_insensitive = true
M.create_hl_autocmd = true
M.current_line_only = false
M.dim_unmatched = true
M.hl_mode = "combine"
M.uppercase_labels = false
M.multi_windows = false
M.windows_list = function ()

View File

@@ -202,7 +202,7 @@ function M.set_hint_extmarks(hl_ns, hints, opts)
api.nvim_buf_set_extmark(hint.jump_target.buffer, hl_ns, row, col, {
virt_text = virt_text,
virt_text_pos = opts.hint_type,
hl_mode = 'combine',
hl_mode = opts.hl_mode,
priority = M.HintPriority.HINT,
})
end