Skip to content

Commit

Permalink
Merge pull request #206 from atomdmac/master
Browse files Browse the repository at this point in the history
feat: Escape filenames before attempting to open them.
  • Loading branch information
EpsilonKu authored Feb 1, 2024
2 parents d958cc3 + 0ff9c31 commit d1ce28b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lua/spectre/actions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ local open_file = function(filename, lnum, col, winid)
vim.fn.win_gotoid(winid)
end
vim.api.nvim_command [[execute "normal! m` "]]
vim.cmd("e " .. filename)
local escaped_filename = vim.fn.fnameescape(filename)
vim.cmd("e " .. escaped_filename)
api.nvim_win_set_cursor(0, { lnum, col })
end

Expand Down

0 comments on commit d1ce28b

Please sign in to comment.