diff options
Diffstat (limited to 'autoload/elm.vim')
-rw-r--r-- | autoload/elm.vim | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/autoload/elm.vim b/autoload/elm.vim index 85a1a0b2..00b15947 100644 --- a/autoload/elm.vim +++ b/autoload/elm.vim @@ -349,11 +349,14 @@ function! elm#FindRootDirectory() abort if empty(l:elm_root) let l:current_file = expand('%:p') let l:dir_current_file = fnameescape(fnamemodify(l:current_file, ':h')) - let l:match = findfile('elm-package.json', l:dir_current_file . ';') - if empty(l:match) - let l:elm_root = '' + let l:old_match = findfile('elm-package.json', l:dir_current_file . ';') + let l:new_match = findfile('elm.json', l:dir_current_file . ';') + if !empty(l:new_match) + let l:elm_root = fnamemodify(l:new_match, ':p:h') + elseif !empty(l:old_match) + let l:elm_root = fnamemodify(l:old_match, ':p:h') else - let l:elm_root = fnamemodify(l:match, ':p:h') + let l:elm_root = '' endif if !empty(l:elm_root) |