From 5df2484601f87c1e4d4a4f3af72fb71ffcf13e96 Mon Sep 17 00:00:00 2001 From: Devin Droddy Date: Mon, 13 Apr 2026 10:16:00 -0400 Subject: [PATCH 1/3] fix: remove `workspace.libraries` from .luarc.json This entirely overrode libraries sent from lsp clients. It makes more sense for individuals to configure their location of the neovim library (not everyone has it installed with homebrew!), and others can be handled with tools like LazyDev. --- .luarc.json | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.luarc.json b/.luarc.json index fcd59b89..cfb7f00c 100644 --- a/.luarc.json +++ b/.luarc.json @@ -4,12 +4,6 @@ "version": "LuaJIT" }, "workspace": { - "library": [ - "/opt/homebrew/share/nvim/runtime/lua/vim/_meta", - "/opt/homebrew/share/nvim/runtime/lua/vim/shared.lua", - "${3rd}/luv/library", - "${3rd}/busted/library" - ], "checkThirdParty": false }, "diagnostics": { From a307ca3f3699cfadc7d20ed772a950268d97381d Mon Sep 17 00:00:00 2001 From: Devin Droddy Date: Mon, 13 Apr 2026 11:37:23 -0400 Subject: [PATCH 2/3] chore: remove unused field `M.state` in `main.lua` --- lua/fff/main.lua | 2 -- 1 file changed, 2 deletions(-) diff --git a/lua/fff/main.lua b/lua/fff/main.lua index 3054d477..6978fe2a 100644 --- a/lua/fff/main.lua +++ b/lua/fff/main.lua @@ -1,7 +1,5 @@ local M = {} -M.state = { initialized = false } - --- Setup the file picker with the given configuration --- @param config table Configuration options function M.setup(config) vim.g.fff = config end From 3b0c7ed07e8cf1e1b1ce3af5871837f19a0deec8 Mon Sep 17 00:00:00 2001 From: Devin Droddy Date: Mon, 13 Apr 2026 10:23:53 -0400 Subject: [PATCH 3/3] feat: function to re-open the most recent search Replicates the "resume" functionality of telescope and Snacks.nvim.picker (see #159) --- lua/fff/main.lua | 6 ++++++ lua/fff/picker_ui.lua | 30 ++++++++++++++++++------------ 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/lua/fff/main.lua b/lua/fff/main.lua index 6978fe2a..f54bdf49 100644 --- a/lua/fff/main.lua +++ b/lua/fff/main.lua @@ -39,6 +39,12 @@ function M.live_grep(opts) picker_ui.open(picker_opts) end +--- Resume the last search. +--- @param opts? table Optional configuration overrides. +function M.resume(opts) + require('fff.picker_ui').open(opts, true) +end + --- Changes the directory indexed by the file picker to the git root and opens the file picker --- @deprecated Use `find_files` instead function M.find_in_git_root() diff --git a/lua/fff/picker_ui.lua b/lua/fff/picker_ui.lua index b1de93d3..6a826e2c 100644 --- a/lua/fff/picker_ui.lua +++ b/lua/fff/picker_ui.lua @@ -592,7 +592,6 @@ function M.create_ui() preview.set_preview_window(M.state.preview_win) M.update_results_sync() - M.clear_preview() M.update_status() return true @@ -2463,6 +2462,12 @@ function M.close() end end + -- Clean up picker focus autocmds + pcall(vim.api.nvim_del_augroup_by_name, 'fff_picker_focus') +end + +--- Reset picker state +function M.reset_state() if M.state.preview_timer then M.state.preview_timer:stop() M.state.preview_timer:close() @@ -2498,8 +2503,6 @@ function M.close() M.state.combo_visible = true M.state.combo_initial_cursor = nil M.reset_history_state() - -- Clean up picker focus autocmds - pcall(vim.api.nvim_del_augroup_by_name, 'fff_picker_focus') end --- Helper function to determine current file cache for deprioritization @@ -2555,7 +2558,9 @@ end --- @param location table|nil Pre-fetched location data --- @param merged_config table Merged configuration --- @param current_file_cache string|nil Current file cache -local function open_ui_with_state(query, results, location, merged_config, current_file_cache) +--- @param resume? boolean Resume previous search +local function open_ui_with_state(query, results, location, merged_config, current_file_cache, resume) + if not resume then M.reset_state() end M.state.config = merged_config if not M.create_ui() then @@ -2569,10 +2574,9 @@ local function open_ui_with_state(query, results, location, merged_config, curre -- Set up initial state if query then M.state.query = query - vim.api.nvim_buf_set_lines(M.state.input_buf, 0, -1, false, { M.state.config.prompt .. query }) - else - M.state.query = '' + resume = false end + vim.api.nvim_buf_set_lines(M.state.input_buf, 0, -1, false, { M.state.config.prompt .. M.state.query }) if results then -- Use prefetched results @@ -2584,7 +2588,7 @@ local function open_ui_with_state(query, results, location, merged_config, curre M.render_list() M.update_preview() M.update_status() - else + elseif not resume then M.update_results() M.clear_preview() M.update_status() @@ -2612,8 +2616,9 @@ end --- @param query string The search query to execute --- @param callback function Function called with results: function(results, metadata, location, get_file_score) -> boolean --- @param opts? table Optional configuration to override defaults (same as M.open) +--- @param resume? boolean Resume previous search --- @return boolean true if callback handled results, false if UI was opened -function M.open_with_callback(query, callback, opts) +function M.open_with_callback(query, callback, opts, resume) if M.state.active then return false end local merged_config, base_path = initialize_picker(opts) @@ -2636,14 +2641,15 @@ function M.open_with_callback(query, callback, opts) end if callback_handled then return true end - open_ui_with_state(query, results, location, merged_config, current_file_cache) + open_ui_with_state(query, results, location, merged_config, current_file_cache, resume) return false end --- Open the file picker UI --- @param opts? {cwd?: string, title?: string, prompt?: string, max_results?: number, max_threads?: number, layout?: {width?: number|function, height?: number|function, prompt_position?: string|function, preview_position?: string|function, preview_size?: number|function}, renderer?: table, mode?: string, grep_config?: table, query?: string} Optional configuration to override defaults -function M.open(opts) +--- @param resume? boolean Resume previous search +function M.open(opts, resume) if M.state.active then return end M.state.selected_files = {} @@ -2669,7 +2675,7 @@ function M.open(opts) local current_file_cache = get_current_file_cache(base_path) local query = opts and opts.query or nil ---@type string|nil - return open_ui_with_state(query, nil, nil, merged_config, current_file_cache) + return open_ui_with_state(query, nil, nil, merged_config, current_file_cache, resume) end --- Change the base directory for the file picker