1
0
mirror of https://github.com/skywind3000/z.lua synced 2026-03-15 12:19:49 +00:00

commit z.lua

This commit is contained in:
skywind3000
2019-02-08 16:08:47 +08:00
parent 8ef9d09c92
commit 961c09dc3b

7
z.lua
View File

@@ -1367,7 +1367,12 @@ function z_cd(patterns)
return os.path.expand('~')
end
if os.path.isabs(last) and os.path.isdir(last) then
return os.path.norm(last)
local size = #patterns
if size <= 1 then
return os.path.norm(last)
elseif last ~= '/' and last ~= '\\' then
return os.path.norm(last)
end
end
local M = z_match(patterns, Z_METHOD, Z_SUBDIR)
if M == nil then