summaryrefslogtreecommitdiff
path: root/autoload
diff options
context:
space:
mode:
authorrhysd <lin90162@yahoo.co.jp>2018-01-25 03:45:07 +0900
committerrhysd <lin90162@yahoo.co.jp>2018-01-25 07:21:25 +0900
commitef898fa3033c10a6176995aba4ccb4567c85e601 (patch)
tree3bb2205fdba3090d4535d56da3b993fcafeb0ee8 /autoload
parent9849c79ff767b9f2e3498230bb29071eeb5a77ef (diff)
downloadale-ef898fa3033c10a6176995aba4ccb4567c85e601.zip
fixjson: Add support for local installation
Diffstat (limited to 'autoload')
-rw-r--r--autoload/ale/fixers/fixjson.vim9
1 files changed, 8 insertions, 1 deletions
diff --git a/autoload/ale/fixers/fixjson.vim b/autoload/ale/fixers/fixjson.vim
index 84728f24..43eb0632 100644
--- a/autoload/ale/fixers/fixjson.vim
+++ b/autoload/ale/fixers/fixjson.vim
@@ -3,9 +3,16 @@
call ale#Set('json_fixjson_executable', 'fixjson')
call ale#Set('json_fixjson_options', '')
+call ale#Set('json_fixjson_use_global', 0)
+
+function! ale#fixers#fixjson#GetExecutable(buffer) abort
+ return ale#node#FindExecutable(a:buffer, 'json_fixjson', [
+ \ 'node_modules/.bin/fixjson',
+ \])
+endfunction
function! ale#fixers#fixjson#Fix(buffer) abort
- let l:executable = ale#Escape(ale#Var(a:buffer, 'json_fixjson_executable'))
+ let l:executable = ale#Escape(ale#fixers#fixjson#GetExecutable(a:buffer))
let l:filename = ale#Escape(bufname(a:buffer))
let l:command = l:executable . ' --stdin-filename ' . l:filename