diff options
author | w0rp <devw0rp@gmail.com> | 2018-08-02 23:44:12 +0100 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2018-08-02 23:44:12 +0100 |
commit | 217284360d35711b751859ed27a7a3c3da300e85 (patch) | |
tree | 4b26a84b397e3ac15a8b13a572b1f9a50312dbab /ale_linters/asm | |
parent | 9ef266d050d698c3ed3be3456ce6a5da5755d5ef (diff) | |
download | ale-217284360d35711b751859ed27a7a3c3da300e85.zip |
Simplify the code for most linters and tests with closures
Diffstat (limited to 'ale_linters/asm')
-rw-r--r-- | ale_linters/asm/gcc.vim | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/ale_linters/asm/gcc.vim b/ale_linters/asm/gcc.vim index 4ac876f8..fdd0ee83 100644 --- a/ale_linters/asm/gcc.vim +++ b/ale_linters/asm/gcc.vim @@ -4,15 +4,10 @@ call ale#Set('asm_gcc_executable', 'gcc') call ale#Set('asm_gcc_options', '-Wall') -function! ale_linters#asm#gcc#GetExecutable(buffer) abort - return ale#Var(a:buffer, 'asm_gcc_executable') -endfunction - function! ale_linters#asm#gcc#GetCommand(buffer) abort - return ale#Escape(ale_linters#asm#gcc#GetExecutable(a:buffer)) - \ . ' -x assembler -fsyntax-only ' - \ . '-iquote ' . ale#Escape(fnamemodify(bufname(a:buffer), ':p:h')) - \ . ' ' . ale#Var(a:buffer, 'asm_gcc_options') . ' -' + return '%e -x assembler -fsyntax-only ' + \ . '-iquote ' . ale#Escape(fnamemodify(bufname(a:buffer), ':p:h')) + \ . ' ' . ale#Var(a:buffer, 'asm_gcc_options') . ' -' endfunction function! ale_linters#asm#gcc#Handle(buffer, lines) abort @@ -33,7 +28,7 @@ endfunction call ale#linter#Define('asm', { \ 'name': 'gcc', \ 'output_stream': 'stderr', -\ 'executable_callback': 'ale_linters#asm#gcc#GetExecutable', +\ 'executable_callback': ale#VarFunc('asm_gcc_executable'), \ 'command_callback': 'ale_linters#asm#gcc#GetCommand', \ 'callback': 'ale_linters#asm#gcc#Handle', \}) |