Skip to content

Commit

Permalink
fix(previewer): regex escape --fixed-strings
Browse files Browse the repository at this point in the history
  • Loading branch information
abdennourzahaf authored and ibhagwan committed Dec 26, 2024
1 parent e724f50 commit 76e25ab
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lua/fzf-lua/previewer/builtin.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1013,9 +1013,10 @@ function Previewer.buffer_or_file:set_cursor_hl(entry)
or self.opts.__ACT_TO == mgrep.live_grep and self.opts.search or nil
if regex and self.opts.rg_glob and self.opts.glob_separator then
regex = require("fzf-lua.make_entry").glob_parse(regex, self.opts)
if self.opts.cmd:match("%-%-fixed-strings") or self.opts.cmd:match("%-F") then
regex = utils.rg_escape(regex)
end
end
if regex and self.opts.cmd
and (self.opts.cmd:match("%-%-fixed%-strings") or self.opts.cmd:match("%-F")) then
regex = utils.rg_escape(regex)
end

-- If called from tags previewer, can happen when using ctags cmd
Expand Down

0 comments on commit 76e25ab

Please sign in to comment.