File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -252,7 +252,7 @@ function Url:_parse_path_type()
252
252
or (first_char == ' ~' and self .path :sub (2 , 2 ) == ' /' )
253
253
then
254
254
self .path_type = ' file'
255
- self .realpath = fs .substitute_path (self .path ) or self .path
255
+ self .realpath = fs .get_real_path (self .path , true ) or self .path
256
256
return
257
257
end
258
258
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ function M.substitute_path(path_str)
21
21
end
22
22
23
23
--- @param filepath string
24
- function M .get_real_path (filepath )
24
+ function M .get_real_path (filepath , match )
25
25
if not filepath then
26
26
return false
27
27
end
@@ -30,6 +30,12 @@ function M.get_real_path(filepath)
30
30
return false
31
31
end
32
32
local real = vim .loop .fs_realpath (substituted )
33
+ if match then
34
+ -- if path ends with / , real needs too
35
+ if filepath :sub (- 1 , - 1 ) == ' /' then
36
+ real = real .. ' /'
37
+ end
38
+ end
33
39
return real or false
34
40
end
35
41
You can’t perform that action at this time.
0 commit comments