diff options
Diffstat (limited to 'autoload')
-rw-r--r-- | autoload/ale/events.vim | 2 | ||||
-rw-r--r-- | autoload/ale/handlers/elixir.vim | 21 | ||||
-rw-r--r-- | autoload/ale/linter.vim | 2 |
3 files changed, 21 insertions, 4 deletions
diff --git a/autoload/ale/events.vim b/autoload/ale/events.vim index e48ad488..61a625df 100644 --- a/autoload/ale/events.vim +++ b/autoload/ale/events.vim @@ -29,7 +29,7 @@ function! ale#events#SaveEvent(buffer) abort call setbufvar(a:buffer, 'ale_save_event_fired', 1) endif - if ale#Var(a:buffer, 'fix_on_save') + if ale#Var(a:buffer, 'fix_on_save') && !ale#events#QuitRecently(a:buffer) let l:will_fix = ale#fix#Fix(a:buffer, 'save_file') let l:should_lint = l:should_lint && !l:will_fix endif diff --git a/autoload/ale/handlers/elixir.vim b/autoload/ale/handlers/elixir.vim index 91b75aac..2fddf8e7 100644 --- a/autoload/ale/handlers/elixir.vim +++ b/autoload/ale/handlers/elixir.vim @@ -1,13 +1,28 @@ " Author: Matteo Centenaro (bugant) - https://github.com/bugant -" -" Description: find the root directory for an elixir project that uses mix +" Author: Jon Parise <jon@indelible.org> +" Description: Functions for working with Elixir projects +" Find the root directory for an elixir project that uses mix. function! ale#handlers#elixir#FindMixProjectRoot(buffer) abort let l:mix_file = ale#path#FindNearestFile(a:buffer, 'mix.exs') if !empty(l:mix_file) - return fnamemodify(l:mix_file, ':p:h') + return fnamemodify(l:mix_file, ':p:h') endif return '.' endfunction + +" Similar to ale#handlers#elixir#FindMixProjectRoot but also continue the +" search upward for a potential umbrella project root. If an umbrella root +" does not exist, the initial project root will be returned. +function! ale#handlers#elixir#FindMixUmbrellaRoot(buffer) abort + let l:app_root = ale#handlers#elixir#FindMixProjectRoot(a:buffer) + let l:umbrella_root = fnamemodify(l:app_root, ':h:h') + + if filereadable(l:umbrella_root . '/mix.exs') + return l:umbrella_root + endif + + return l:app_root +endfunction diff --git a/autoload/ale/linter.vim b/autoload/ale/linter.vim index 114765e6..0a249282 100644 --- a/autoload/ale/linter.vim +++ b/autoload/ale/linter.vim @@ -16,6 +16,7 @@ let s:default_ale_linter_aliases = { \ 'systemverilog': 'verilog', \ 'verilog_systemverilog': ['verilog_systemverilog', 'verilog'], \ 'vimwiki': 'markdown', +\ 'vue': ['vue', 'javascript'], \ 'zsh': 'sh', \} @@ -40,6 +41,7 @@ let s:default_ale_linters = { \ 'rust': ['cargo'], \ 'spec': [], \ 'text': [], +\ 'vue': ['eslint', 'vls'], \ 'zsh': ['shell'], \} |