Skip to content

Commit 8b60639

Browse files
committed
Fix detection of paths with bogus directories
Closes tpope#313.
1 parent a42761b commit 8b60639

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

plugin/rails.vim

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,13 @@ function! RailsDetect(...) abort
2727
endif
2828
let fn = substitute(fnamemodify(a:0 ? a:1 : expand('%'), ":p"),'\c^file://','','')
2929
let sep = exists('+shellslash') && !&shellslash ? '\\' : '/'
30-
if fn =~# ':[\\/][\\/]'
31-
return 0
32-
elseif isdirectory(fn)
30+
if isdirectory(fn)
3331
let fn = fnamemodify(fn,':s?[\/]$??')
3432
else
3533
let fn = fnamemodify(fn,':s?\(.*\)[\/][^\/]*$?\1?')
34+
if !isdirectory(fn)
35+
return 0
36+
endif
3637
endif
3738
let ofn = ""
3839
let fns = []

0 commit comments

Comments
 (0)