Skip to content

Commit

Permalink
don't sort list of rcfiles, just use the order as found by findfile()
Browse files Browse the repository at this point in the history
There was a problemi (github issue embear#42) with localvimrc files that are
links to a file in another directory. Sorting the list of localvimrc
files with their resolved abloute path the order could have been wrong.
  • Loading branch information
embear committed Feb 3, 2016
1 parent b9ee060 commit 1ff9e7a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions plugin/localvimrc.vim
Original file line number Diff line number Diff line change
Expand Up @@ -185,13 +185,12 @@ function! s:LocalVimRC()
call s:LocalVimRCDebug(2, "searching directory \"" . l:directory . "\"")

" generate a list of all local vimrc files with absolute file names along path to root
let l:absolute = {}
let l:rcfiles = []
for l:rcname in s:localvimrc_name
for l:rcfile in findfile(l:rcname, l:directory . ";", -1)
let l:absolute[resolve(fnamemodify(l:rcfile, ":p"))] = ""
call insert(l:rcfiles, resolve(fnamemodify(l:rcfile, ":p")))
endfor
endfor
let l:rcfiles = sort(keys(l:absolute))
call s:LocalVimRCDebug(1, "found files: " . string(l:rcfiles))

" shrink list of found files
Expand Down

0 comments on commit 1ff9e7a

Please sign in to comment.