From d43b70d93987c94d15a352cf0026fb93d3317cc8 Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Wed, 26 Dec 2018 10:41:57 +0100 Subject: Update --- autoload/elm.vim | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'autoload/elm.vim') 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) -- cgit v1.2.3