Skip to content

Commit

Permalink
revert: feat(highlight): allow highlighting the full pattern (#180)
Browse files Browse the repository at this point in the history
This reverts commit ad775a7.
  • Loading branch information
folke committed Jul 6, 2024
1 parent 0954987 commit 996d1a7
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lua/todo-comments/highlight.lua
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,9 @@ function M.match(str, patterns)
for _, pattern in pairs(patterns) do
local m = vim.fn.matchlist(str, [[\v\C]] .. pattern)
if #m > 1 and m[2] then
local matched = m[1]
local kw_only = m[2]
local start = str:find(matched, 1, true)
return start, start + #matched - 1, kw_only
local kw = m[2]
local start = str:find(kw)
return start, start + #kw, kw
end
end
end
Expand Down

0 comments on commit 996d1a7

Please sign in to comment.