diff options
author | w0rp <devw0rp@gmail.com> | 2020-08-28 19:50:36 +0100 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2020-08-28 19:50:36 +0100 |
commit | 7d4ce4e6aa960a6052a16d90322566d6f4fddb7c (patch) | |
tree | 0f191e0dff643cc4b53f6dbd5259fef028d7a0dd /autoload | |
parent | 3d5a2690ce707cbc9e71e8ed4d5d1955e4b26d65 (diff) | |
download | ale-7d4ce4e6aa960a6052a16d90322566d6f4fddb7c.zip |
Close #3325 - Apply new formatting where possible
Diffstat (limited to 'autoload')
-rw-r--r-- | autoload/ale/c.vim | 6 | ||||
-rw-r--r-- | autoload/ale/fixers/ocamlformat.vim | 3 | ||||
-rw-r--r-- | autoload/ale/fixers/rubocop.vim | 3 |
3 files changed, 5 insertions, 7 deletions
diff --git a/autoload/ale/c.vim b/autoload/ale/c.vim index 64668dd5..d0a4fa06 100644 --- a/autoload/ale/c.vim +++ b/autoload/ale/c.vim @@ -501,10 +501,10 @@ endfunction function! ale#c#GetMakeCommand(buffer) abort if s:CanParseMakefile(a:buffer) - let l:makefile_path = ale#path#FindNearestFile(a:buffer, 'Makefile') + let l:path = ale#path#FindNearestFile(a:buffer, 'Makefile') - if !empty(l:makefile_path) - return 'cd '. fnamemodify(l:makefile_path, ':p:h') . ' && make -n' + if !empty(l:path) + return ale#path#CdString(fnamemodify(l:path, ':h')) . 'make -n' endif endif diff --git a/autoload/ale/fixers/ocamlformat.vim b/autoload/ale/fixers/ocamlformat.vim index 9b7c3e12..b12d2eb9 100644 --- a/autoload/ale/fixers/ocamlformat.vim +++ b/autoload/ale/fixers/ocamlformat.vim @@ -5,14 +5,13 @@ call ale#Set('ocaml_ocamlformat_executable', 'ocamlformat') call ale#Set('ocaml_ocamlformat_options', '') function! ale#fixers#ocamlformat#Fix(buffer) abort - let l:filename = expand('#' . a:buffer . ':p') let l:executable = ale#Var(a:buffer, 'ocaml_ocamlformat_executable') let l:options = ale#Var(a:buffer, 'ocaml_ocamlformat_options') return { \ 'command': ale#Escape(l:executable) \ . (empty(l:options) ? '' : ' ' . l:options) - \ . ' --name=' . ale#Escape(l:filename) + \ . ' --name=%s' \ . ' -' \} endfunction diff --git a/autoload/ale/fixers/rubocop.vim b/autoload/ale/fixers/rubocop.vim index d9615256..cdfb014a 100644 --- a/autoload/ale/fixers/rubocop.vim +++ b/autoload/ale/fixers/rubocop.vim @@ -29,8 +29,7 @@ function! ale#fixers#rubocop#GetCommand(buffer) abort \ . (!empty(l:config) ? ' --config ' . ale#Escape(l:config) : '') \ . (!empty(l:options) ? ' ' . l:options : '') \ . (l:auto_correct_all ? ' --auto-correct-all' : ' --auto-correct') - \ . ' --force-exclusion --stdin ' - \ . ale#Escape(expand('#' . a:buffer . ':p')) + \ . ' --force-exclusion --stdin %s' endfunction function! ale#fixers#rubocop#Fix(buffer) abort |