File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -230,7 +230,7 @@ local S_IF = {
230
230
}
231
231
232
232
--- @class plenary.path2
233
- --- @field home string home directory path
233
+ --- @field home string ? home directory path
234
234
--- @field sep string OS path separator respecting ' shellslash'
235
235
--- @field isshellslash boolean whether shellslash is on (always false on unix systems )
236
236
---
@@ -241,7 +241,6 @@ local S_IF = {
241
241
--- @field root fun ( base : string ?): string
242
242
--- @field S_IF { DIR : integer , REG : integer } stat filetype bitmask
243
243
local path = setmetatable ({
244
- home = vim .fn .getcwd (), -- respects shellslash unlike vim.uv.cwd()
245
244
S_IF = S_IF ,
246
245
}, {
247
246
__index = function (t , k )
@@ -262,6 +261,19 @@ local path = setmetatable({
262
261
263
262
return t .isshellslash and " /" or " \\ "
264
263
end
264
+
265
+ if k == " home" then
266
+ if not iswin then
267
+ t .home = uv .os_homedir ()
268
+ return t .home
269
+ end
270
+
271
+ local home = uv .os_homedir ()
272
+ if home == nil then
273
+ return home
274
+ end
275
+ return (home :gsub (" \\ " , t .sep ))
276
+ end
265
277
end ,
266
278
})
267
279
You can’t perform that action at this time.
0 commit comments