aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpml68 <contact@pml68.dev>2025-03-23 02:21:22 +0100
committerpml68 <contact@pml68.dev>2025-03-23 02:21:22 +0100
commit2a4f74cd9bd7429ee48e428a0fa93253182e44e0 (patch)
treec4f6478cc33d26e5a36bebd5c3d22598f3edbd24
parentfix: make inlay hints toggle local to current buffer (diff)
downloadnvim-2a4f74cd9bd7429ee48e428a0fa93253182e44e0.tar.gz
feat: update TODO finder fn
-rw-r--r--lua/pml68/remap.lua30
-rw-r--r--spell/en.utf-8.add1
-rw-r--r--spell/en.utf-8.add.splbin181 -> 194 bytes
3 files changed, 19 insertions, 12 deletions
diff --git a/lua/pml68/remap.lua b/lua/pml68/remap.lua
index 3846493..950140d 100644
--- a/lua/pml68/remap.lua
+++ b/lua/pml68/remap.lua
@@ -64,22 +64,28 @@ vim.keymap.set('n', '<leader>fg', "<cmd>Telescope git_files<CR>", {})
vim.keymap.set('n', '<leader>fd', "<cmd>Telescope diagnostics<CR>", {})
vim.keymap.set('n', '<leader>ft', function()
local telescope = require("telescope.builtin")
- local todo_files = {}
-
- local handle = io.popen("rg --files -g 'TODO.{md,txt}'")
+ local handle = io.popen("rg 'TODO'")
local result = handle:read("*a")
handle:close()
- for file in result:gmatch("[^\r\n]+") do
- table.insert(todo_files, file)
- end
+ if result:match("[^\r\n]+") == nil then
+ local todo_files = {}
+
+ local files_handle = io.popen("rg --files -g 'TODO.{md,txt}'")
+ local files_result = files_handle:read("*a")
+ files_handle:close()
+
+ for file in files_result:gmatch("[^\r\n]+") do
+ table.insert(todo_files, file)
+ end
- if #todo_files > 0 then
- telescope.find_files({
- prompt_title = "Choose TODO file",
- cwd = vim.fn.getcwd(),
- search_dirs = todo_files
- })
+ if #todo_files > 0 then
+ telescope.find_files({
+ prompt_title = "Choose TODO file",
+ cwd = vim.fn.getcwd(),
+ search_dirs = todo_files
+ })
+ end
else
telescope.grep_string({ search = "TODO" })
end
diff --git a/spell/en.utf-8.add b/spell/en.utf-8.add
index a3a7570..35173ee 100644
--- a/spell/en.utf-8.add
+++ b/spell/en.utf-8.add
@@ -10,3 +10,4 @@ Rosé
tmux
texlive
aur
+backend
diff --git a/spell/en.utf-8.add.spl b/spell/en.utf-8.add.spl
index 8b03803..fcd6907 100644
--- a/spell/en.utf-8.add.spl
+++ b/spell/en.utf-8.add.spl
Binary files differ