Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Opens File in unexpected split #205

Open
beatgutzwiller opened this issue Feb 16, 2017 · 5 comments
Open

Opens File in unexpected split #205

beatgutzwiller opened this issue Feb 16, 2017 · 5 comments

Comments

@beatgutzwiller
Copy link

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
Copy link
Collaborator

ches commented Apr 1, 2017

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
Copy link

Muffo commented Sep 14, 2017

I am observing the same issue.

From the result panel at the bottom:

  • Pressing ENTER opens the file inside the same panel at the bottom, hiding the other results
  • Pressing o opens the file as a new buffer and leave the Ack results at the bottom (expected behavior)

@beatgutzwiller
Copy link
Author

beatgutzwiller commented Nov 28, 2017

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:

  • It seems to behave exactly like :grep
  • I've seen Muffos issue multiple times, but can not reproduce it and it is not what i meant.

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
Copy link

Muffo commented Jan 2, 2018

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

@Asheboy
Copy link

Asheboy commented Feb 15, 2021

I am experiencing this too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants