diff options
| author | Mitermayer Reis <mitermayer.reis@gmail.com> | 2017-08-12 17:27:01 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-08-12 17:27:01 -0700 |
| commit | 7d4dff0c939b240645b0d9ed073e1f7e5ed7b2e6 (patch) | |
| tree | d597952e0f4e9133a8a8c3f8d445dff672f6c54a | |
| parent | 6ce93e244d2292fa6e89359e0fc190235c17a2ff (diff) | |
| parent | 5604fda679b91ce77c1e714bd5a043e24a577011 (diff) | |
| download | vim-prettier-7d4dff0c939b240645b0d9ed073e1f7e5ed7b2e6.tar.xz | |
Merge pull request #40 from prettier/issue-39/prettier-quickfix-other-plugins-compatibility
bugfix: should not clear quickfix unless opened by vim-prettier itself
| -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 |
