From 46df7f1188aec6fc957199696989f6ddd9d43ab4 Mon Sep 17 00:00:00 2001 From: SyntaxError2505 Date: Mon, 18 May 2026 22:34:40 +0200 Subject: [PATCH 1/9] added find_help_pages function --- lua/fff/main.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lua/fff/main.lua b/lua/fff/main.lua index 92d9a746..7a92c69a 100644 --- a/lua/fff/main.lua +++ b/lua/fff/main.lua @@ -17,6 +17,16 @@ function M.find_files(opts) end end +function M.find_help_pages(opts) + local picker_ok, picker_ui = pcall(require, 'fff.picker_ui') + if picker_ok then + picker_ui.open({cwd = vim.env.VIMRUNTIME .. "/doc"}) + else + vim.notify('Failed to load picker UI: ' .. picker_ui, vim.log.levels.ERROR) + end +end + + --- Live grep: search file contents in the current directory --- @param opts? {cwd?: string, title?: string, prompt?: string, layout?: table, grep?: {max_file_size?: number, smart_case?: boolean, max_matches_per_file?: number, modes?: string[]}, query?: string} Optional configuration overrides function M.live_grep(opts) From 0826a71df08c3bb553f5b5dc277035a8a37caf91 Mon Sep 17 00:00:00 2001 From: SyntaxError2505 Date: Mon, 18 May 2026 22:39:21 +0200 Subject: [PATCH 2/9] added check for if VIMRUNTIME does not exist --- lua/fff/main.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/fff/main.lua b/lua/fff/main.lua index 7a92c69a..b021ee55 100644 --- a/lua/fff/main.lua +++ b/lua/fff/main.lua @@ -20,7 +20,8 @@ end function M.find_help_pages(opts) local picker_ok, picker_ui = pcall(require, 'fff.picker_ui') if picker_ok then - picker_ui.open({cwd = vim.env.VIMRUNTIME .. "/doc"}) + local vimruntime = vim.env.VIMRUNTIME or vim.fn.stdpath('data') + picker_ui.open({cwd = vimruntime .. "/doc"}) else vim.notify('Failed to load picker UI: ' .. picker_ui, vim.log.levels.ERROR) end From 35a8139605f53df844d41e67683e23b51d3ac8bf Mon Sep 17 00:00:00 2001 From: SyntaxError2505 Date: Tue, 19 May 2026 14:25:53 +0200 Subject: [PATCH 3/9] switched to fuzzy grep and used M.live_grep because drys --- lua/fff/main.lua | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/lua/fff/main.lua b/lua/fff/main.lua index b021ee55..d0be5bbd 100644 --- a/lua/fff/main.lua +++ b/lua/fff/main.lua @@ -17,17 +17,10 @@ function M.find_files(opts) end end -function M.find_help_pages(opts) - local picker_ok, picker_ui = pcall(require, 'fff.picker_ui') - if picker_ok then - local vimruntime = vim.env.VIMRUNTIME or vim.fn.stdpath('data') - picker_ui.open({cwd = vimruntime .. "/doc"}) - else - vim.notify('Failed to load picker UI: ' .. picker_ui, vim.log.levels.ERROR) - end +function M.fuzzy_find_help_pages(opts) + M.live_grep({ cwd = vim.api.VIMRUNTIME, grep = { modes = "fuzzy" } }) end - --- Live grep: search file contents in the current directory --- @param opts? {cwd?: string, title?: string, prompt?: string, layout?: table, grep?: {max_file_size?: number, smart_case?: boolean, max_matches_per_file?: number, modes?: string[]}, query?: string} Optional configuration overrides function M.live_grep(opts) From d0c84c5a98c760a7cb8e20f1825bc3ab9fcea638 Mon Sep 17 00:00:00 2001 From: SyntaxError2505 Date: Tue, 19 May 2026 15:01:40 +0200 Subject: [PATCH 4/9] fixed VIMRUNTIME search --- lua/fff/main.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/fff/main.lua b/lua/fff/main.lua index d0be5bbd..2894bbf2 100644 --- a/lua/fff/main.lua +++ b/lua/fff/main.lua @@ -18,7 +18,7 @@ function M.find_files(opts) end function M.fuzzy_find_help_pages(opts) - M.live_grep({ cwd = vim.api.VIMRUNTIME, grep = { modes = "fuzzy" } }) + M.live_grep({ cwd = vim.env.VIMRUNTIME, grep = { modes = "fuzzy" } }) end --- Live grep: search file contents in the current directory From 28dd4c401602c4d1179d63ba5d2498e25e2eac99 Mon Sep 17 00:00:00 2001 From: SyntaxError2505 Date: Tue, 19 May 2026 15:03:30 +0200 Subject: [PATCH 5/9] added /doc to avoid reading trough VIMRUNTIME --- lua/fff/main.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/fff/main.lua b/lua/fff/main.lua index 2894bbf2..9242bee2 100644 --- a/lua/fff/main.lua +++ b/lua/fff/main.lua @@ -18,7 +18,7 @@ function M.find_files(opts) end function M.fuzzy_find_help_pages(opts) - M.live_grep({ cwd = vim.env.VIMRUNTIME, grep = { modes = "fuzzy" } }) + M.live_grep({ cwd = vim.env.VIMRUNTIME .. "/doc", grep = { modes = "fuzzy" } }) end --- Live grep: search file contents in the current directory From e19708011d0e686047875f700d0f51d98e4ea472 Mon Sep 17 00:00:00 2001 From: SyntaxError2505 Date: Tue, 19 May 2026 15:12:50 +0200 Subject: [PATCH 6/9] removed fuzzy finding for better opts --- lua/fff/main.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lua/fff/main.lua b/lua/fff/main.lua index 9242bee2..6d3175d8 100644 --- a/lua/fff/main.lua +++ b/lua/fff/main.lua @@ -17,8 +17,10 @@ function M.find_files(opts) end end -function M.fuzzy_find_help_pages(opts) - M.live_grep({ cwd = vim.env.VIMRUNTIME .. "/doc", grep = { modes = "fuzzy" } }) +function M.find_help_pages(opts) + local options = opts + opts.cwd = vim.env.VIMRUNTIME .. "/doc" + M.find_files({ cwd = vim.env.VIMRUNTIME .. "/doc", grep = {modes = "fuzzy"}}) end --- Live grep: search file contents in the current directory From 50f4841d123c6d55a6a0ad922cd432534014cbdf Mon Sep 17 00:00:00 2001 From: SyntaxError2505 Date: Tue, 19 May 2026 15:13:56 +0200 Subject: [PATCH 7/9] input opts into the last find_files call --- lua/fff/main.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lua/fff/main.lua b/lua/fff/main.lua index 6d3175d8..91a97be7 100644 --- a/lua/fff/main.lua +++ b/lua/fff/main.lua @@ -17,10 +17,12 @@ function M.find_files(opts) end end +--- Find help pages +--- @param opts? table Optional configuration {renderer = custom_renderer} function M.find_help_pages(opts) local options = opts opts.cwd = vim.env.VIMRUNTIME .. "/doc" - M.find_files({ cwd = vim.env.VIMRUNTIME .. "/doc", grep = {modes = "fuzzy"}}) + M.find_files(opts) end --- Live grep: search file contents in the current directory From 78d62f53e4c320211503bc0bf4a1c201c17565aa Mon Sep 17 00:00:00 2001 From: SyntaxError2505 Date: Tue, 19 May 2026 15:24:18 +0200 Subject: [PATCH 8/9] switched to options so that I dont just pass the arg --- lua/fff/main.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/fff/main.lua b/lua/fff/main.lua index 91a97be7..fcc765ce 100644 --- a/lua/fff/main.lua +++ b/lua/fff/main.lua @@ -22,7 +22,7 @@ end function M.find_help_pages(opts) local options = opts opts.cwd = vim.env.VIMRUNTIME .. "/doc" - M.find_files(opts) + M.find_files(options) end --- Live grep: search file contents in the current directory From 3f996032e34aa7d3436804c260f794711f0055eb Mon Sep 17 00:00:00 2001 From: SyntaxError2505 Date: Wed, 20 May 2026 08:25:07 +0200 Subject: [PATCH 9/9] made find_help_pages follow style guide --- lua/fff/main.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lua/fff/main.lua b/lua/fff/main.lua index fcc765ce..79073318 100644 --- a/lua/fff/main.lua +++ b/lua/fff/main.lua @@ -20,9 +20,9 @@ end --- Find help pages --- @param opts? table Optional configuration {renderer = custom_renderer} function M.find_help_pages(opts) - local options = opts - opts.cwd = vim.env.VIMRUNTIME .. "/doc" - M.find_files(options) + local options = opts + opts.cwd = vim.env.VIMRUNTIME .. "/doc" + M.find_files(options) end --- Live grep: search file contents in the current directory