diff options
| author | Mitermayer Reis <mitermayer.reis@gmail.com> | 2018-03-25 14:58:39 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-03-25 14:58:39 -0700 |
| commit | 2116a4b6d7712bfc5ce13c70c12f8c8dd4acb7f9 (patch) | |
| tree | 325079f3f2bf46fdd8d79718876f275c98bac5e8 /autoload/prettier.vim | |
| parent | c722ab7c4d10f0af678450bb251c353d02633ace (diff) | |
| parent | 12367470eeba432b4020f31649295126fedcb238 (diff) | |
| download | vim-prettier-2116a4b6d7712bfc5ce13c70c12f8c8dd4acb7f9.tar.xz | |
Merge pull request #122 from docwhat/pr/no-focus-quickfix
don't change focus to the quicklist
Diffstat (limited to 'autoload/prettier.vim')
| -rw-r--r-- | autoload/prettier.vim | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/autoload/prettier.vim b/autoload/prettier.vim index bda5b66..54cce8d 100644 --- a/autoload/prettier.vim +++ b/autoload/prettier.vim @@ -48,7 +48,7 @@ function! prettier#Prettier(...) abort " close quickfix if it is opened if s:prettier_quickfix_open - call setqflist([]) + call setqflist([], 'r') cclose let s:prettier_quickfix_open = 0 endif @@ -248,8 +248,13 @@ function! s:Handle_Parsing_Errors(out) abort endfor if len(l:errors) - call setqflist(l:errors) + let l:winnr = winnr() + call setqflist(l:errors, 'r') botright copen + if !g:prettier#no_focus_quicklist + " Return the cursor back to the main buffer. + exe l:winnr . 'wincmd w' + endif let s:prettier_quickfix_open = 1 endif endfunction |
