Skip to content

Commit

Permalink
fix: escape "%" in gsub target
Browse files Browse the repository at this point in the history
  • Loading branch information
phanen authored and ibhagwan committed Sep 14, 2024
1 parent 985e100 commit f513524
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lua/fzf-lua/make_entry.lua
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,8 @@ M.file = function(x, opts)
else
ret[#ret + 1] = file_is_ansi > 0
-- filename is ansi escape colored, replace the inner string (#819)
and file_part:gsub(utils.lua_regex_escape(stripped_filepath), filepath)
-- escape `%` in path, since `string.gsub` also use it in target (#1443)
and file_part:gsub(utils.lua_regex_escape(stripped_filepath), (filepath:gsub("%%", "%%%%")))
or filepath
end
-- multiline is only enabled with grep-like output PATH:LINE:COL:
Expand Down

0 comments on commit f513524

Please sign in to comment.