fix: also filter out selected files when using fzf and telescope (#947)

This commit is contained in:
yetone 2024-12-13 23:23:16 +08:00 committed by GitHub
parent 1516ce093a
commit 4d1447b62f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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(),