File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change 960960--- @return string ? err Error string
961961M .fs_parent = function (path , loose )
962962 path = M .path_join (vim .fn .getcwd (), path )
963- if # M .abspath_prefix (path ) == # path then
963+ local prefix = M .abspath_prefix (path )
964+ if prefix and # prefix >= # path then
964965 return nil
965966 end
966967
Original file line number Diff line number Diff line change @@ -5,8 +5,8 @@ local uv = vim.uv or vim.loop
55describe (" fs_parent" , function ()
66 it (" works" , function ()
77 assert .are .same (nil , utils .fs_parent (" /" ))
8- assert .are .same (uv . fs_realpath ( " / " ) , utils .fs_parent (" /foo" ))
9- assert .are .same (uv . fs_realpath ( " / " ) , utils .fs_parent (" /foo/bar" , true ))
8+ assert .are .same (utils . path_separator , utils .fs_parent (" /foo" ))
9+ assert .are .same (utils . path_separator , utils .fs_parent (" /foo/bar" , true ))
1010 assert .are .same (nil , utils .fs_parent (" /foo/bar" , false ))
1111 end )
1212end )
You can’t perform that action at this time.
0 commit comments