summaryrefslogtreecommitdiff
path: root/autoload/ale/fixers/ocp_indent.vim
blob: e1b047b394fbc4c44850a44e4f42e7563c87f2bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
" Author: Kanenobu Mitsuru
" Description: Integration of ocp-indent with ALE.

call ale#Set('ocaml_ocp_indent_executable', 'ocp-indent')
call ale#Set('ocaml_ocp_indent_options', '')
call ale#Set('ocaml_ocp_indent_config', '')

function! ale#fixers#ocp_indent#Fix(buffer) abort
    let l:executable = ale#Var(a:buffer, 'ocaml_ocp_indent_executable')
    let l:config = ale#Var(a:buffer, 'ocaml_ocp_indent_config')
    let l:options = ale#Var(a:buffer, 'ocaml_ocp_indent_options')

    return {
    \   'command': ale#Escape(l:executable)
    \       . (empty(l:config) ? '' : ' --config=' . ale#Escape(l:config))
    \       . (empty(l:options) ? '': ' ' . l:options)
    \}
endfunction