Skip to content

Commit

Permalink
Fix Windows spaces issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Kayzels committed May 14, 2024
1 parent a6d918f commit 5a55641
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lua/yazi/health.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ return {

-- parse the version

local semver = raw_version:match('^[Yy]azi (%w+%.%w+%.%w+)')
local semver = raw_version:match('[Yy]azi (%w+%.%w+%.%w+)')

if semver == nil then
vim.health.warn('yazi --version looks unexpected, saw ' .. raw_version)
Expand Down
3 changes: 3 additions & 0 deletions lua/yazi/utils/path.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ local M = {}
M.escape_path_for_cmd = function(path)
local escaped_path = vim.fn.fnameescape(path)
if M.is_windows then
-- Replace forward slash spaces with just spaces.
escaped_path = escaped_path:gsub('\\ ', ' ')

-- on windows, some punctuation preceeded by a `\` needs to have a second
-- `\` added to preserve the path separator. this is a naive replacement and
-- definitely not bullet proof. if we start finding issues with opening files
Expand Down

0 comments on commit 5a55641

Please sign in to comment.