Thanks for your suggestions, I'm now wrapping asyncrun to run my scripts. And I noticed the asyncrun#quickfix_toggle(size, ...) function in the source code, described as "fast command to toggle quickfix" . And I myself use the following function to toggle quickfix window:
function! foo#qf#Toggle() abort
if !exists('s:qf_opened')
let l:winid = win_getid()
execute 'botright copen'
call win_gotoid(l:winid)
let s:qf_opened = 1
return
endif
if s:qf_opened
execute 'cclose'
let s:qf_opened = 0
else
let l:winid = win_getid()
execute 'botright copen'
call win_gotoid(l:winid)
let s:qf_opened = 1
endif
endfunction
Thus a friendly question: does your function has better performance with winsaveview/winrestview and without win_gotoid? Thanks.
Thanks for your suggestions, I'm now wrapping asyncrun to run my scripts. And I noticed the
asyncrun#quickfix_toggle(size, ...)
function in the source code, described as "fast command to toggle quickfix" . And I myself use the following function to toggle quickfix window:Thus a friendly question: does your function has better performance with
winsaveview
/winrestview
and withoutwin_gotoid
? Thanks.