From 7f881f66a845ed8f056e5246e7cbbfc2e95bea07 Mon Sep 17 00:00:00 2001 From: jhlink Date: Fri, 10 Jul 2020 17:46:01 -0400 Subject: [PATCH] feat: Add ALE fixer for astyle --- autoload/ale/fixers/astyle.vim | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 autoload/ale/fixers/astyle.vim diff --git a/autoload/ale/fixers/astyle.vim b/autoload/ale/fixers/astyle.vim new file mode 100644 index 00000000..3ee48031 --- /dev/null +++ b/autoload/ale/fixers/astyle.vim @@ -0,0 +1,14 @@ +" Author: James Kim +" Description: Fix C/C++ files with astyle. + +call ale#Set('c_astyle_executable', 'astyle') + +function! ale#fixers#astyle#Fix(buffer) abort + let l:executable = ale#Var(a:buffer, 'c_astyle_executable') + + return { + \ 'command': ale#Escape(l:executable) + \ . ' %t', + \ 'read_temporary_file': 1, + \} +endfunction