From 4d1447b62f2e31059a0bd53d7ed9b5496c0c18a3 Mon Sep 17 00:00:00 2001 From: yetone Date: Fri, 13 Dec 2024 23:23:16 +0800 Subject: [PATCH] fix: also filter out selected files when using fzf and telescope (#947) --- lua/avante/file_selector.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lua/avante/file_selector.lua b/lua/avante/file_selector.lua index f4c5f73..2493cb6 100644 --- a/lua/avante/file_selector.lua +++ b/lua/avante/file_selector.lua @@ -134,6 +134,7 @@ function FileSelector:fzf_ui(handler) local close_action = function() handler(nil) end fzf_lua.files(vim.tbl_deep_extend("force", Config.file_selector.provider_opts, { + file_ignore_patterns = self.selected_filepaths, prompt = string.format("%s> ", PROMPT_TITLE), fzf_opts = {}, git_icons = false, @@ -165,6 +166,7 @@ function FileSelector:telescope_ui(handler) .new( {}, vim.tbl_extend("force", Config.file_selector.provider_opts, { + file_ignore_patterns = self.selected_filepaths, prompt_title = string.format("%s> ", PROMPT_TITLE), finder = finders.new_oneshot_job({ "git", "ls-files" }, { cwd = Utils.get_project_root() }), sorter = conf.file_sorter(),