mileszs / ack.vim

Vim plugin for the Perl module / CLI script 'ack'
Other
3.08k stars 396 forks source link

Opens File in unexpected split #205

Open beatgutzwiller opened 7 years ago

beatgutzwiller commented 7 years ago

It seems like a file is open in the first opened split. This is quite irritating. Am I doing something wrong, or is this a limitation of ack.vim ? It would be great to open the file in the last active split. And even better (at least for me) would be if ack woul behave like vinegar.vim/newtr and instead of open a quickfixlist, showing the result in the active split, and open the file there.

ches commented 7 years ago

It seems like a file is open in the first opened split. This is quite irritating. Am I doing something wrong, or is this a limitation of ack.vim ?

To understand what you're asking or wishing to behave differently, please try doing the same thing with :grep instead of :Ack and reporting if :Ack behaves differently. ack.vim tries to mirror Vim's :grep behavior, this is intentional.

If you want to have more control over where results/splits are opened, take a look at #170 and see if it achieves what you wish for. vim-qf is another alternative.

As far as behaving like netrw, you're probably just going to want to seek another plugin if that's what you'd prefer. Again, ack.vim is designed to be seamlessly familiar to a user of :grep.

Muffo commented 7 years ago

I am observing the same issue.

From the result panel at the bottom:

beatgutzwiller commented 6 years ago

Hi there

Really sorry for leaving you waiting for so long. Totaly forgotten. Just stumbled over it on google again. I am really sorry I've not answered until now, I will explain my issues in a moment, but here is the tl;dr:

So after all I think Muffos issue should be a own issue and this should be closed as obviously bad Issue. I would like to apologize sincerly, I was young and dumb back then =)

To explain what i meant and to at least learn something about vimgrep i would be thankfully if you explain me the following.

I have a fresh vim instance with one split. I open a new file in a vsp and one in an sp. It looks like that:

   |  C  |       |
   | --  |   A   |
   |  B  |       |

The cursor is in Split C and here is what happens:

If I use :grep or :ack the first result opens in split C as i would supsect. But every file I open from the quicklist, is opened in Split B not in Spilt C

If I use :grep! or :ack! every file I open from the quicklist is opened in Split B.

I have no idea why it used the secondlast split. If I do the same with the following constellation:

   |  C  |  D  |
   | --  |  -- |
   |  B  |  A  |

And the curso is in split D both :grep! and :ack! will open the files in split D.

So if anybody could explain that to me i would be really thankfull.

Muffo commented 6 years ago

Thanks for the clarification! Unfortunately I can't help with your question, but I will open a separate ticket for my issue.

Asheboy commented 3 years ago

I am experiencing this too.