summaryrefslogtreecommitdiff
path: root/autoload
diff options
context:
space:
mode:
authorFernando Mendes <devfrmendes@gmail.com>2018-03-08 14:37:56 +0000
committerFernando Mendes <devfrmendes@gmail.com>2018-03-08 15:29:10 +0000
commit6320ce66742fd8bf73b8f77341669b2c1505c47d (patch)
treee800fb7649736bba4aed2cacb4308c42d53a6206 /autoload
parent0a0535546f4d9a0dfe02671630fdaba72ea5828d (diff)
downloadale-6320ce66742fd8bf73b8f77341669b2c1505c47d.zip
Allow passing options to mix_format
Diffstat (limited to 'autoload')
-rw-r--r--autoload/ale/fixers/mix_format.vim13
1 files changed, 10 insertions, 3 deletions
diff --git a/autoload/ale/fixers/mix_format.vim b/autoload/ale/fixers/mix_format.vim
index 04866408..3847d1b6 100644
--- a/autoload/ale/fixers/mix_format.vim
+++ b/autoload/ale/fixers/mix_format.vim
@@ -1,16 +1,23 @@
-" Author: carakan <carakan@gmail.com>
+" Author: carakan <carakan@gmail.com>, Fernando Mendes <fernando@mendes.codes>
" Description: Fixing files with elixir formatter 'mix format'.
call ale#Set('elixir_mix_executable', 'mix')
+call ale#Set('elixir_mix_format_options', '')
function! ale#fixers#mix_format#GetExecutable(buffer) abort
return ale#Var(a:buffer, 'elixir_mix_executable')
endfunction
+function! ale#fixers#mix_format#GetCommand(buffer) abort
+ let l:executable = ale#Escape(ale#fixers#mix_format#GetExecutable(a:buffer))
+ let l:options = ale#Var(a:buffer, 'elixir_mix_format_options')
+
+ return l:executable . ' format ' . l:options . ' %t'
+endfunction
+
function! ale#fixers#mix_format#Fix(buffer) abort
return {
- \ 'command': ale#Escape(ale#fixers#mix_format#GetExecutable(a:buffer))
- \ . ' format %t',
+ \ 'command': ale#fixers#mix_format#GetCommand(a:buffer),
\ 'read_temporary_file': 1,
\}
endfunction