aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitermayer Reis <mitermayer.reis@gmail.com>2020-08-03 16:53:19 +1000
committerGitHub <noreply@github.com>2020-08-03 16:53:19 +1000
commit674360e9df699b959e38127bc7f15a89c1502f68 (patch)
tree967f4975a9ccdddb29b19e00da60e63541a9ea28
parent5e5d51d4b1c8ad2e99cc24cce23e684a5ad1e5f1 (diff)
parentc60cfefd2e42915549af9ec5c90ad683041baf37 (diff)
downloadvim-prettier-674360e9df699b959e38127bc7f15a89c1502f68.tar.xz
Merge pull request #252 from mrnugget/fix-nvim-onexit-error
Fix error when quitting Neovim with :wq
-rw-r--r--autoload/prettier/job/async/neovim.vim2
1 files changed, 2 insertions, 0 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]