File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -1008,15 +1008,23 @@ function Previewer.base:maybe_set_cursorline(win, pos)
1008
1008
end
1009
1009
1010
1010
function Previewer .buffer_or_file :set_cursor_hl (entry )
1011
- local mgrep = require (" fzf-lua.providers.grep" )
1011
+ local mgrep , glob_args = require (" fzf-lua.providers.grep" ), nil
1012
1012
local regex = self .opts .__ACT_TO == mgrep .grep and self .opts ._last_query
1013
1013
or self .opts .__ACT_TO == mgrep .live_grep and self .opts .search or nil
1014
1014
if regex and self .opts .rg_glob and self .opts .glob_separator then
1015
- regex = require (" fzf-lua.make_entry" ).glob_parse (regex , self .opts )
1015
+ regex , glob_args = require (" fzf-lua.make_entry" ).glob_parse (regex , self .opts )
1016
1016
end
1017
- if regex and self .opts .cmd
1018
- and (self .opts .cmd :match (" %-%-fixed%-strings" ) or self .opts .cmd :match (" %-F" )) then
1019
- regex = utils .rg_escape (regex )
1017
+ if regex then
1018
+ (function ()
1019
+ -- Check both the cmd and glob_args in case the user has a custom
1020
+ -- `rg_glob_fn` which uses raw args (as the wiki example)
1021
+ local strs = { self .opts .cmd , glob_args }
1022
+ for _ , s in ipairs (strs ) do
1023
+ if s and (s :match (" %-%-fixed%-strings" ) or s :match (" %-F" )) then
1024
+ regex = utils .rg_escape (regex )
1025
+ end
1026
+ end
1027
+ end )()
1020
1028
end
1021
1029
1022
1030
-- If called from tags previewer, can happen when using ctags cmd
You can’t perform that action at this time.
0 commit comments