Skip to content

Commit 3bac023

Browse files
committed
Fix edge cases in absolute path construction
1 parent d2df19b commit 3bac023

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

plugin/rails.vim

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ function! RailsDetect(...) abort
2727
endif
2828
let path = a:0 ? a:1 : @%
2929
if exists('*ProjectionistHas')
30-
if path !~# '^/\|^\a\+:'
30+
if len(&l:buftype)
31+
let path = fnamemodify(path, ':p')
32+
elseif path !~# '^$\|^/\|^\a\+:\|^\\\\'
3133
let path = getcwd() . '/' . path
3234
endif
3335
let previous = ''

0 commit comments

Comments
 (0)