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

j/k does not work right with vsplit #238

Closed
matejcik opened this issue Feb 27, 2018 · 2 comments
Closed

j/k does not work right with vsplit #238

matejcik opened this issue Feb 27, 2018 · 2 comments
Labels

Comments

@matejcik
Copy link

to reproduce:

  1. vsplit your window
  2. :Ack! word, where "word" is something that exists in multiple files in your cwd
  3. attempt to move between search results using j/k, going from one file to another

expected:
cursor moves up/down on the result list, and the highlight in the current window follows the selected result

actual:
when moving across file boundary, cursor skips to the right vsplit and moves there instead

with g:ackpreview=1 this happens whenever you go from one file to another; without it, it only happens when going from a different file back to the currently open one

probably related to #219 and #66 ?

@ches ches closed this as completed in 36e40f9 Feb 27, 2018
@ches
Copy link
Collaborator

ches commented Feb 27, 2018

I see what you mean in the case of g:ackpreview=1—I don't use that feature, but it was doing something clearly wrong. Can you try updating the plugin now?

I'm afraid I can't reproduce what you describe when g:ackpreview=0, we don't remap j and k at all in that case so there should be no way that the cursor focus jumps out of the results buffer.

If you still have a problem in either case after updating, let me know, maybe I need another explanation of how to reproduce.

@ches ches added the bug label Feb 27, 2018
@matejcik
Copy link
Author

I think I see the problem...

This commit does fix all issues I was experiencing (so thanks, and wow that was fast!).
However, actually setting g:ackpreview=0 does not disable preview! Because your code is checking for exists(ackpreview), which is true even with zero value. So either the check is wrong, or the documentation is misleading (stating that default is 0, when default is unset).

(I'm not sure why I saw different behavior. Probably I was confused and not reproducing my own steps correctly.)

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

No branches or pull requests

2 participants