Skip to content

Commit

Permalink
fix(labeler): dont include end_pos to re-use stable labels
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Jun 16, 2023
1 parent 9bb8079 commit dadca0e
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions lua/flash/labeler.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,10 @@ function M:update()

if self.state.opts.highlight.label.stable then
for _, match in ipairs(matches) do
if not self:label(match, true) then
break
end
self:label(match, true)
end
end

for _, match in ipairs(matches) do
if not self:label(match) then
break
Expand All @@ -55,11 +54,6 @@ function M:reset()
end
end

---@param fn fun(labels: string[]): string[]
function M:validate(fn)
self.labels = fn(self.labels)
end

function M:valid(label)
return vim.tbl_contains(self.labels, label)
end
Expand All @@ -76,7 +70,7 @@ function M:label(m, used)
if m.label then
return true
end
local pos = m.pos:id(m.win) .. ":" .. m.end_pos:id(m.win)
local pos = m.pos:id(m.win)
local label ---@type string?
if used then
label = self.used[pos]
Expand Down

0 comments on commit dadca0e

Please sign in to comment.