Skip to content

Commit

Permalink
refactor: use states from utils
Browse files Browse the repository at this point in the history
  • Loading branch information
max397574 committed Mar 30, 2022
1 parent 81a792b commit 7bd9467
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 20 deletions.
11 changes: 1 addition & 10 deletions lua/telescope/_extensions/neorg/find_aof_tasks.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,7 @@ local neorg_loaded, _ = pcall(require, "neorg.modules")

assert(neorg_loaded, "Neorg is not loaded - please make sure to load Neorg first")

local states = {
["undone"] = { "-[ ] ", "NeorgTodoItem1Undone" },
["done"] = { "-[x] ", "NeorgTodoItem1Done" },
["pending"] = { "-[-] ", "NeorgTodoItem1Pending" },
["cancelled"] = { "-[_] ", "NeorgTodoItem1Cancelled" },
["uncertain"] = { "-[?] ", "NeorgTodoItem1Uncertain" },
["urgent"] = { "-[!] ", "NeorgTodoItem1Urgent" },
["recurring"] = { "-[+] ", "NeorgTodoItem1Recurring" },
["on_hold"] = { "-[=] ", "NeorgTodoItem1OnHold" },
}
local states = utils.states

local function get_aof_projects()
local projects = utils.get_projects()
Expand Down
12 changes: 2 additions & 10 deletions lua/telescope/_extensions/neorg/find_context_tasks.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
local utils = require("neorg.telescope_utils")
local actions = require("telescope.actions")
local actions_set = require("telescope.actions.set")
local state = require("telescope.actions.state")
Expand All @@ -13,16 +14,7 @@ local neorg_loaded, _ = pcall(require, "neorg.modules")

assert(neorg_loaded, "Neorg is not loaded - please make sure to load Neorg first")

local states = {
["undone"] = { "-[ ] ", "NeorgTodoItem1Undone" },
["done"] = { "-[x] ", "NeorgTodoItem1Done" },
["pending"] = { "-[-] ", "NeorgTodoItem1Pending" },
["cancelled"] = { "-[_] ", "NeorgTodoItem1Cancelled" },
["uncertain"] = { "-[?] ", "NeorgTodoItem1Uncertain" },
["urgent"] = { "-[!] ", "NeorgTodoItem1Urgent" },
["recurring"] = { "-[+] ", "NeorgTodoItem1Recurring" },
["on_hold"] = { "-[=] ", "NeorgTodoItem1OnHold" },
}
local states = utils.states

local function get_context_tasks()
local tasks_raw = neorg.modules.get_module("core.gtd.queries").get("tasks")
Expand Down

0 comments on commit 7bd9467

Please sign in to comment.