From 6320ce66742fd8bf73b8f77341669b2c1505c47d Mon Sep 17 00:00:00 2001 From: Fernando Mendes Date: Thu, 8 Mar 2018 14:37:56 +0000 Subject: Allow passing options to mix_format --- autoload/ale/fixers/mix_format.vim | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'autoload') 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 +" Author: carakan , Fernando Mendes " 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 -- cgit v1.2.3