File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 110
110
--- @return string root
111
111
--- @return string relpath
112
112
function _PosixPath :split_root (part )
113
- if part :sub (1 ) == self .sep then
114
- part = (part :gsub (" ^" .. self .sep , " " ))
115
- return " " , self .sep , part :sub (2 , # part )
113
+ if part :sub (1 , 1 ) == self .sep then
114
+ return " " , self .sep , part :sub (2 )
116
115
end
117
116
return " " , " " , part
118
117
end
@@ -386,7 +385,7 @@ function Path:is_absolute()
386
385
return false
387
386
end
388
387
389
- return self ._flavor .has_drv and self .drv ~= " "
388
+ return not self ._flavor .has_drv or self .drv ~= " "
390
389
end
391
390
392
391
--- @return boolean
@@ -509,8 +508,9 @@ function Path:make_relative(to)
509
508
end
510
509
511
510
-- vim.o.shellslash = false
512
- local p = Path :new { " C:" , " lua" , " .." , " README.md" }
513
- print (p .filename )
511
+ local p = Path :new { " /mnt/c/Users/jtrew/neovim/plenary.nvim/README.md" }
512
+ vim .print (p .drv , p .root , p .relparts )
513
+ print (p .filename , p :is_absolute ())
514
514
-- vim.o.shellslash = true
515
515
516
516
return Path
You can’t perform that action at this time.
0 commit comments