I always return to the leftmost window, not the latest active window when I exit the search results
acgtyrant opened this issue · 1 comments
acgtyrant commented
ches commented
Yes, this is a known effect of the way we open the quickfix list by default, spanning the bottom of the tabpage. It is nothing particular to ack.vim, you'll see the same behavior if you try something like this:
:vimgrep /something/f *
:botright copen
:q
There are couple of ways you can avoid it:
- Use
LAck[!]
to populate results in the location list instead of quickfix list. This opens the list in a split below your active window only, not across the tabpage. Closing the window will then leave the cursor back where you started. - Change the default value of
g:ack_qhandler
. See:help g:ack_qhandler
—the default isbotright copen
, if youlet g:ack_qhandler = 'copen'
then the quickfix list will also be opened as a split of your active window only, like above but with:Ack[!]
.
Closing as this is just how Vim works, not a problem of ack.vim, and I believe the above suggestions give fair options for workarounds if it bothers you. Sorry that it took so long to respond!