diff --git a/lua/oil/util.lua b/lua/oil/util.lua index 441421b9..6dc85a83 100644 --- a/lua/oil/util.lua +++ b/lua/oil/util.lua @@ -21,7 +21,7 @@ end ---@param filename string ---@return string M.escape_filename = function(filename) - local ret = filename:gsub("([%%#$])", "\\%1") + local ret = vim.fn.fnameescape(filename) return ret end