File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -132,14 +132,21 @@ local mappings = {
132132 :with_silent ()
133133 :with_desc (" tool: Find patterns" ),
134134 [" v|<leader>fs" ] = map_callback (function ()
135- local default_opts = " --column --line-number --no-heading --color=always --smart-case"
136- local opts = vim .fn .getcwd () == vim_path and default_opts .. " --no-ignore --hidden --glob '!.git/*'"
137- or " "
138- local text = require (" fzf-lua.utils" ).get_visual_selection ()
139- require (" fzf-lua" ).grep_project ({
140- search = text ,
141- rg_opts = opts ,
142- })
135+ local search_backend = require (" core.settings" ).search_backend
136+ if search_backend == " fzf" then
137+ local default_opts = " --column --line-number --no-heading --color=always --smart-case"
138+ local opts = vim .fn .getcwd () == vim_path
139+ and default_opts .. " --no-ignore --hidden --glob '!.git/*'"
140+ or " "
141+ local text = require (" fzf-lua.utils" ).get_visual_selection ()
142+ require (" fzf-lua" ).grep_project ({
143+ search = text ,
144+ rg_opts = opts ,
145+ })
146+ else
147+ local opts = vim .fn .getcwd () == vim_path and { additional_args = { " --no-ignore" } } or {}
148+ require (" telescope-live-grep-args.shortcuts" ).grep_visual_selection (opts )
149+ end
143150 end )
144151 :with_noremap ()
145152 :with_silent ()
You can’t perform that action at this time.
0 commit comments