Skip to content

Commit

Permalink
feat: make sign priority configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Jun 17, 2021
1 parent 014959e commit edbe161
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ Todo comes with the following defaults:
```lua
{
signs = true, -- show icons in the signs column
sign_priority = 8, -- sign priority
-- keywords recognized as todo comments
keywords = {
FIX = {
Expand Down
1 change: 1 addition & 0 deletions lua/todo-comments/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ M.ns = vim.api.nvim_create_namespace("todo-comments")
-- TODO: add support for markdown todos
local defaults = {
signs = true, -- show icons in the signs column
sign_priority = 8, -- sign priority
-- keywords recognized as todo comments
keywords = {
FIX = {
Expand Down
8 changes: 7 additions & 1 deletion lua/todo-comments/highlight.lua
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,13 @@ function M.highlight(buf, first, last)
show_sign = opts.signs
end
if show_sign then
vim.fn.sign_place(0, "todo-signs", "todo-sign-" .. kw, buf, { lnum = lnum + 1, priority = 8 })
vim.fn.sign_place(
0,
"todo-signs",
"todo-sign-" .. kw,
buf,
{ lnum = lnum + 1, priority = Config.options.sign_priority }
)
end
end
end
Expand Down

0 comments on commit edbe161

Please sign in to comment.