mirror of
https://github.com/dense-analysis/ale.git
synced 2026-02-16 23:14:27 +08:00
Clean up the nimpretty code
This commit is contained in:
@@ -3,19 +3,13 @@
|
||||
|
||||
call ale#Set('nim_nimpretty_executable', 'nimpretty')
|
||||
call ale#Set('nim_nimpretty_options', '--maxLineLen:80')
|
||||
call ale#Set('nim_nimpretty_use_global', get(g:, 'ale_use_global_executables', 0))
|
||||
|
||||
function! ale#fixers#nimpretty#GetExecutable(buffer) abort
|
||||
return ale#node#FindExecutable(a:buffer, 'nim_nimpretty', ['nimpretty'])
|
||||
endfunction
|
||||
|
||||
function! ale#fixers#nimpretty#Fix(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'nim_nimpretty_executable')
|
||||
let l:options = ale#Var(a:buffer, 'nim_nimpretty_options')
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(ale#fixers#nimpretty#GetExecutable(a:buffer))
|
||||
\ . ' %t'
|
||||
\ . (empty(l:options) ? '' : ' ' . l:options),
|
||||
\ 'command': ale#Escape(l:executable) . ' %t' . ale#Pad(l:options),
|
||||
\ 'read_temporary_file': 1,
|
||||
\}
|
||||
endfunction
|
||||
|
||||
Reference in New Issue
Block a user