Skip to content

Commit 582c4f6

Browse files
committed
Adjust 'path' ordering
Bram has decreed that ftplugin/ruby.vim should unconditionally inherit "." and "" from the default global 'path'. This change accounts for that, preserving their position at the very end. This change also incidentally impacts asset files, which seems fine.
1 parent a4595b4 commit 582c4f6

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

autoload/rails.vim

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4855,16 +4855,16 @@ function! s:map_gf() abort
48554855
endfunction
48564856

48574857
function! rails#update_path(before, after) abort
4858-
if &l:path =~# '\v^\.%(,/%(usr|emx)/include)=,,$'
4859-
let before = []
4860-
let after = []
4858+
if &l:path =~# '\v^\.%(,/%(usr|emx)/include)=,,$|^$'
4859+
let append = ''
4860+
let old = []
48614861
else
4862-
let before = &l:path =~# '^\.\%(,\|$\)' ? ['.'] : []
4863-
let after = s:pathsplit(s:sub(&l:path, '^\.%(,|$)', ''))
4862+
let append = matchstr(&l:path, '\%(,\.\)\=\%(,,\)$')
4863+
let old = s:pathsplit(&l:path[0 : -len(append) - 1])
48644864
endif
48654865

48664866
let r = 'substitute(v:val, "^\\a\\a\\+:", "+&", "")'
4867-
let &l:path = s:pathjoin(s:uniq(before + map(a:before, r) + after + map(a:after, r)))
4867+
let &l:path = s:pathjoin(s:uniq(map(a:before, r) + old + map(a:after, r))) . append
48684868
endfunction
48694869

48704870
function! rails#sprockets_setup(type) abort

0 commit comments

Comments
 (0)