diff options
| author | mitermayer <mitermayer.reis@gmail.com> | 2017-08-12 17:17:23 -0700 |
|---|---|---|
| committer | mitermayer <mitermayer.reis@gmail.com> | 2017-08-12 17:20:05 -0700 |
| commit | 5604fda679b91ce77c1e714bd5a043e24a577011 (patch) | |
| tree | d597952e0f4e9133a8a8c3f8d445dff672f6c54a | |
| parent | 6ce93e244d2292fa6e89359e0fc190235c17a2ff (diff) | |
| download | vim-prettier-5604fda679b91ce77c1e714bd5a043e24a577011.tar.xz | |
bugfix: should not clear quickfix unles there are errors
- making sure quickfix list is not cleared unless it is already opened
with errors
| -rw-r--r-- | autoload/prettier.vim | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/autoload/prettier.vim b/autoload/prettier.vim index 16061d8..bfbd54a 100644 --- a/autoload/prettier.vim +++ b/autoload/prettier.vim @@ -1,5 +1,6 @@ let s:root_dir = fnamemodify(resolve(expand('<sfile>:p')), ':h') let s:prettier_job_running = 0 +let s:prettier_quickfix_open = 0 function! prettier#Prettier(...) abort let l:execCmd = s:Get_Prettier_Exec() @@ -11,9 +12,12 @@ function! prettier#Prettier(...) abort if l:execCmd != -1 let l:cmd = l:execCmd . s:Get_Prettier_Exec_Args(l:config) - " close quickfix - call setqflist([]) - cclose + " close quickfix if it is opened + if s:prettier_quickfix_open + call setqflist([]) + cclose + let s:prettier_quickfix_open = 0 + endif if l:async && v:version >= 800 && exists('*job_start') call s:Prettier_Exec_Async(l:cmd, l:startSelection, l:endSelection) @@ -122,6 +126,7 @@ function! s:Handle_Parsing_Errors(out) abort if len(l:errors) call setqflist(l:errors) botright copen + let s:prettier_quickfix_open = 1 endif endfunction |
