Skip to content

Commit

Permalink
fix: completion for TODO items (#711)
Browse files Browse the repository at this point in the history
Co-authored-by: vhyrro <76052559+vhyrro@users.noreply.github.com>
  • Loading branch information
HendrikPetertje and vhyrro authored Jan 12, 2023
1 parent 4ad7952 commit 9184027
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion lua/neorg/modules/core/integrations/nvim-cmp/module.lua
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ module.public = {
end

function module.private.source:get_trigger_characters()
return { "@", "-", "[", " ", "." }
return { "@", "-", "(", " ", "." }
end

module.private.cmp.register_source("neorg", module.private.source)
Expand Down
20 changes: 10 additions & 10 deletions lua/neorg/modules/core/norg/completion/module.lua
Original file line number Diff line number Diff line change
Expand Up @@ -219,23 +219,23 @@ module.public = {
},
},
{
regex = "^%s*%-+%s+%[([x%*%s]?)",
regex = "^%s*%-+%s+%(([x%*%s]?)",

complete = {
{ "[ ] ", label = "[ ] (undone)" },
{ "[-] ", label = "[-] (pending)" },
{ "[x] ", label = "[x] (done)" },
{ "[_] ", label = "[_] (cancelled)" },
{ "[!] ", label = "[!] (important)" },
{ "[+] ", label = "[+] (recurring)" },
{ "[=] ", label = "[=] (on hold)" },
{ "[?] ", label = "[?] (uncertain)" },
{ "( ) ", label = "( ) (undone)" },
{ "(-) ", label = "(-) (pending)" },
{ "(x) ", label = "(x) (done)" },
{ "(_) ", label = "(_) (cancelled)" },
{ "(!) ", label = "(!) (important)" },
{ "(+) ", label = "(+) (recurring)" },
{ "(=) ", label = "(=) (on hold)" },
{ "(?) ", label = "(?) (uncertain)" },
},

options = {
type = "TODO",
pre = function()
local sub = vim.api.nvim_get_current_line():gsub("^(%s*%-+%s+%[%s*)%]", "%1")
local sub = vim.api.nvim_get_current_line():gsub("^(%s*%-+%s+%(%s*)%)", "%1")

if sub then
vim.api.nvim_set_current_line(sub)
Expand Down

0 comments on commit 9184027

Please sign in to comment.