Skip to content

Commit

Permalink
feat: added option to label the first match
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Jun 8, 2023
1 parent 7ff8411 commit 63b75ed
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion lua/flash/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,17 @@ local defaults = {
wrap = true,
},
ui = {
-- add a label for the first match in the current window.
-- you can always jump to the first match with `<CR>`
label_first = false,
-- show a backdrop with hl FlashBackdrop
backdrop = true,
-- When using flash during search, flash will additionally
-- highlight the matches the same way as the search highlight.
-- This is useful to prevent flickring during search.
-- Especially with plugins like noice.nvim.
always_highlight_search = true,
backdrop = true,
-- extmakr priority
priority = 5000,
},
}
Expand Down
2 changes: 1 addition & 1 deletion lua/flash/jump.lua
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function M.update(state)
for _, m in ipairs(state.results) do
-- only label visible matches
-- and don't label the first match in the current window
if m.visible and not (m.first and m.win == state.win) then
if m.visible and not (m.first and m.win == state.win and not state.config.ui.label_first) then
m.label = table.remove(labels, 1)
end
end
Expand Down

0 comments on commit 63b75ed

Please sign in to comment.