install.fairie/dotfiles/.vim/plugged/vim-prettier/autoload/prettier/utils/quickfix.vim
Git E2E Dev Test Username a8e788a215 git subrepo clone (merge) https://github.com/prettier/vim-prettier.git ./dotfiles/.vim/plugged/vim-prettier
subrepo:
  subdir:   "dotfiles/.vim/plugged/vim-prettier"
  merged:   "5e6cca21"
upstream:
  origin:   "https://github.com/prettier/vim-prettier.git"
  branch:   "master"
  commit:   "5e6cca21"
git-subrepo:
  version:  "0.4.3"
  origin:   "???"
  commit:   "???"
2022-10-18 10:36:42 -04:00

22 lines
621 B
VimL

" We use this flag so that we ensure only clearing quickfix if it was created by prettier itself
let s:prettier_quickfix_open = 0
function! prettier#utils#quickfix#close() abort
" close quickfix if it is opened
if s:prettier_quickfix_open
call setqflist([], 'r')
cclose
let s:prettier_quickfix_open = 0
endif
endfunction
function! prettier#utils#quickfix#open(errors, focus) abort
let s:prettier_quickfix_open = 1
let l:winnr = winnr()
call setqflist(a:errors, 'r')
botright copen
if !a:focus
" Return the cursor back to the main buffer.
exe l:winnr . 'wincmd w'
endif
endfunction