diff options
Diffstat (limited to 'autoload/prettier')
| -rw-r--r-- | autoload/prettier/job/async/neovim.vim | 2 | ||||
| -rw-r--r-- | autoload/prettier/resolver/executable.vim | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/autoload/prettier/job/async/neovim.vim b/autoload/prettier/job/async/neovim.vim index 7f69f4e..35e5f82 100644 --- a/autoload/prettier/job/async/neovim.vim +++ b/autoload/prettier/job/async/neovim.vim @@ -42,6 +42,8 @@ endfunction " " note that somehow we exectuing both async and sync on nvim when using the autoformat function! s:onExit(status, info, out, err) abort + if len(a:out) == 0 | return | endif + let l:currentBufferNumber = bufnr('%') let l:isInsideAnotherBuffer = a:info.buf_nr != l:currentBufferNumber ? 1 : 0 let l:last = a:out[len(a:out) - 1] diff --git a/autoload/prettier/resolver/executable.vim b/autoload/prettier/resolver/executable.vim index 8d233ab..0cb0b02 100644 --- a/autoload/prettier/resolver/executable.vim +++ b/autoload/prettier/resolver/executable.vim @@ -33,7 +33,12 @@ endfunction function! s:GetExecPath(...) abort let l:rootDir = a:0 > 0 ? a:1 : -1 let l:dir = l:rootDir != -1 ? l:rootDir . '/.bin/' : '' - return l:dir . 'prettier' + let l:path = l:dir . get(b:, 'prettier_exec_cmd', 'prettier') + if executable(l:path) + return l:path + else + return l:dir . 'prettier' + endif endfunction " Searches for the existence of a directory accross |
