summaryrefslogtreecommitdiff
path: root/autoload
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-06-06 23:13:53 +0100
committerw0rp <devw0rp@gmail.com>2017-06-06 23:13:53 +0100
commitf30652a98f6c350ca02dde8d43c9eaafb1ac9f18 (patch)
treeb852c4241b3051bf0a6a84f6b9bd16517e258e92 /autoload
parente4d886d4a798208d2c5dd10816cd3f47a8f5f431 (diff)
downloadale-f30652a98f6c350ca02dde8d43c9eaafb1ac9f18.zip
Allow ALEFix functions to be defined with only the buffer argument
Diffstat (limited to 'autoload')
-rw-r--r--autoload/ale/fix.vim5
1 files changed, 4 insertions, 1 deletions
diff --git a/autoload/ale/fix.vim b/autoload/ale/fix.vim
index d8a50a2d..7513a7cc 100644
--- a/autoload/ale/fix.vim
+++ b/autoload/ale/fix.vim
@@ -232,7 +232,10 @@ function! s:RunFixer(options) abort
let l:index = a:options.callback_index
while len(a:options.callback_list) > l:index
- let l:result = call(a:options.callback_list[l:index], [l:buffer, copy(l:input)])
+ let l:Function = a:options.callback_list[l:index]
+ let l:result = ale#util#FunctionArgCount(l:Function) == 1
+ \ ? call(l:Function, [l:buffer])
+ \ : call(l:Function, [l:buffer, copy(l:input)])
if type(l:result) == type(0) && l:result == 0
" When `0` is returned, skip this item.