I have an autocmd, if ft
is qf
, it is gonna call some functions to modify the quickfix list by get/setqflist()
I know there ar
The only reliable way I've found, is to store the current window number, then issue a :copen
command. If the active window number changes, you were in the location list and not the quickfix list. If it doesn't change, you were already in the quickfix list.
You also want to store the number of open windows, and compare that to the new number of open windows. Then you can close the quickfix window if it wasn't already open.
Finally you can jump back to the location list (if needed) using the stored window number and wincmd w
.