Skip to content

Commit 566e805

Browse files
drop-stonesibhagwan
authored andcommitted
fix(previewer): Apply fn_transform_cmd to regex query parsing
1 parent a20539f commit 566e805

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

lua/fzf-lua/previewer/builtin.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1040,7 +1040,10 @@ function Previewer.buffer_or_file:set_cursor_hl(entry)
10401040
local mgrep, glob_args = require("fzf-lua.providers.grep"), nil
10411041
local regex = self.opts.__ACT_TO == mgrep.grep and self.opts._last_query
10421042
or self.opts.__ACT_TO == mgrep.live_grep and self.opts.search or nil
1043-
if regex and self.opts.rg_glob and self.opts.glob_separator then
1043+
if regex and self.opts.fn_transform_cmd then
1044+
local _, query = self.opts.fn_transform_cmd(regex, self.opts.cmd, self.opts)
1045+
regex = query or regex
1046+
elseif regex and self.opts.rg_glob and self.opts.glob_separator then
10441047
regex, glob_args = require("fzf-lua.make_entry").glob_parse(regex, self.opts)
10451048
end
10461049
if regex then

0 commit comments

Comments
 (0)