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/glsl/glslang.vim | |
parent | 9ef266d050d698c3ed3be3456ce6a5da5755d5ef (diff) | |
download | ale-217284360d35711b751859ed27a7a3c3da300e85.zip |
Simplify the code for most linters and tests with closures
Diffstat (limited to 'ale_linters/glsl/glslang.vim')
-rw-r--r-- | ale_linters/glsl/glslang.vim | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/ale_linters/glsl/glslang.vim b/ale_linters/glsl/glslang.vim index d494df0e..d55a5e7c 100644 --- a/ale_linters/glsl/glslang.vim +++ b/ale_linters/glsl/glslang.vim @@ -4,17 +4,11 @@ " TODO: Once https://github.com/KhronosGroup/glslang/pull/1047 is accepted, " we can use stdin. -let g:ale_glsl_glslang_executable = -\ get(g:, 'ale_glsl_glslang_executable', 'glslangValidator') - -let g:ale_glsl_glslang_options = get(g:, 'ale_glsl_glslang_options', '') - -function! ale_linters#glsl#glslang#GetExecutable(buffer) abort - return ale#Var(a:buffer, 'glsl_glslang_executable') -endfunction +call ale#Set('glsl_glslang_executable', 'glslangValidator') +call ale#Set('glsl_glslang_options', '') function! ale_linters#glsl#glslang#GetCommand(buffer) abort - return ale#Escape(ale_linters#glsl#glslang#GetExecutable(a:buffer)) + return '%e' \ . ale#Pad(ale#Var(a:buffer, 'glsl_glslang_options')) \ . ' -C %t' endfunction @@ -40,7 +34,7 @@ endfunction call ale#linter#Define('glsl', { \ 'name': 'glslang', -\ 'executable_callback': 'ale_linters#glsl#glslang#GetExecutable', +\ 'executable_callback': ale#VarFunc('glsl_glslang_executable'), \ 'command_callback': 'ale_linters#glsl#glslang#GetCommand', \ 'callback': 'ale_linters#glsl#glslang#Handle', \}) |