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

Fix file name search after using VinegarUp (the - key). #138

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

serebrov
Copy link
Contributor

Recently file search after opening netfw buffer does not work consistently. Sometimes pressing "-" opens the parent directory with the cursor on the first line instead of the current file line.

The actual problem is that the alternative buffer name is empty after going to the netrw buffer and expand('#:t') returns empty string.

This change fixes it by saving the current file name before opening the netrw buffer.

Note that underlying issue is not solved: the alternative buffer is still empty, so Ctrl-6 to go back to file from netrw still does not work. I did not try to research the problem with the alternative buffer.

Should be related to #136. The issue mentions "Vim >= 9.0", I have neovim 0.10.0 currently (not sure, but it might be possible that the problem appeared after upgrade to 0.10.0).

Recently it does not always work. Sometimes pressing "-"
opens the parent directory with the cursor on the first
line instead of the current file line.

The actual problem is that the alternative buffer name is
empty after going to the netrw buffer and `expand('#:t')`
returns empty string.

This change fixes it by saving the curren file name before
opening the netrw buffer.

Note that underlying issue is not solved: the alternative
buffer is still empty, so Ctrl-6 to go back still does not work.

Related to tpope#136
@serebrov serebrov changed the title Fixe file name search after using VinegarUp (the - key). Fix file name search after using VinegarUp (the - key). Jun 30, 2024
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 this pull request may close these issues.

1 participant