Skip to content

Commit 9c92daf

Browse files
committed
Avoid extra slash when getcwd() == "/"
1 parent 5c0c19a commit 9c92daf

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

plugin/rails.vim

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ function! RailsDetect(...) abort
3838
return
3939
endif
4040
if !s:IsAbs(path)
41-
let path = getcwd() . (exists('+shellslash') && !&shellslash ? '\' : '/') . path
41+
let s = exists('+shellslash') && !&shellslash ? '\' : '/'
42+
let path = substitute(getcwd(), '\' . s . '\=$', s, '') . path
4243
endif
4344
let path = substitute(path, '[' . s:slash . '/]$', '', '')
4445
try

0 commit comments

Comments
 (0)