Skip to content

Commit

Permalink
feat: add hl_mode to change highlight of hint char
Browse files Browse the repository at this point in the history
  • Loading branch information
henry-hsieh committed Apr 25, 2024
1 parent 059e88e commit 97f8b49
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
9 changes: 9 additions & 0 deletions doc/hop.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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:~
`dim_unmatched = "combine"`

`direction` *hop-config-direction*
Direction in which to hint. See |hop.hint.HintDirection| for further
details.
Expand Down
1 change: 1 addition & 0 deletions lua/hop/defaults.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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 ()
Expand Down
2 changes: 1 addition & 1 deletion lua/hop/hint.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 97f8b49

Please sign in to comment.