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

Open folds when opening/previewing matches #33

Open
losingkeys opened this issue Dec 23, 2013 · 8 comments · May be fixed by #35
Open

Open folds when opening/previewing matches #33

losingkeys opened this issue Dec 23, 2013 · 8 comments · May be fixed by #35

Comments

@losingkeys
Copy link
Collaborator

Originally reported on the vim_use mailing list here: https://groups.google.com/d/msg/vim_use/L9E3EJqd610/9o1Uq2p_9bwJ .

@fritzophrenic
Copy link

From same vim_use thread: need to add a zv to the end of normal-mode mappings if you want folds to open from a mapping.

@losingkeys
Copy link
Collaborator Author

I'm confused as to why this works: losingkeys@a0e4258. Aren't I still in the quickfix window when the mapping uses zv? If so, shouldn't it try that command on the (not folded) line in the quickfix window, actually show the match, then continue to show the match (not opening folds like it was before?

@fritzophrenic
Copy link

In the quickfix window, by default, pressing <CR> on an item will open the file for that item in a buffer and then jump to the line for that item within that buffer. So after the <CR>, you'll no longer be in the quickfix window. Therefore mapping something to <CR>zv should work to show the fold. If you want to end up in the quickfix window, you'd further need to add a <C-w>p to your mapping.

@losingkeys
Copy link
Collaborator Author

Yeah, that's what I thought... but losingkeys@a0e4258 seems to work fine. So zv works anywhere in a mapping for all movements that mapping might make?

@fritzophrenic
Copy link

I don't think that's how zv is supposed to work. I'm not sure why those
changes in your commit would work, if they do. What's the extra space
between zv and the rest for?

@losingkeys
Copy link
Collaborator Author

Hmm, I'll move them around then. They do work though, which is odd. I put the space there because I thought it needed to be there to separate the normal mode & command mode commands. It doesn't look like that's the case (and now that I think of it, that doesn't make a whole lot of sense). Thanks for your comments, I'll make a pull request when I've fixed that commit up.

@losingkeys
Copy link
Collaborator Author

That said, it's cleaner to just put it in front if it works. What do you think about just leaving it there?

@fritzophrenic
Copy link

Don't care, I don't use it. I'm was just trying to do a good turn when I
saw the vim_use post in case you weren't following it. Do what you want :-)

losingkeys added a commit to losingkeys/ag.vim that referenced this issue Dec 24, 2013
losingkeys added a commit to losingkeys/ag.vim that referenced this issue Dec 24, 2013
@losingkeys losingkeys linked a pull request Dec 24, 2013 that will close this issue
Numkil pushed a commit to Numkil/ag.nvim that referenced this issue Dec 18, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants