Skip to content

Commit

Permalink
fix: exit when buffer no longer exists
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed May 15, 2021
1 parent 172fd55 commit 3bc3bce
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lua/todo-comments/highlight.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ end
-- highlights the range for the given buf
-- FIX: rerendering of line is glitchy
function M.highlight(buf, first, last)
if not vim.api.nvim_buf_is_valid(buf) then
return
end
vim.api.nvim_buf_clear_namespace(buf, Config.ns, first, last + 1)

-- clear signs
Expand Down

0 comments on commit 3bc3bce

Please sign in to comment.