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: add early returns to buffer switch hook #29

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

Conversation

tvsfx
Copy link

@tvsfx tvsfx commented Sep 3, 2024

The existing update_current_buffer_on_switch method has a bug because early return statements are missing. This pull request adds those statements.

Concretely, in the case where the file we are switching away from does not exist in the target worktree, we do not return and hence both execute the change command and call nvim_set_current_buf, hence unintentionally opening an empty buffer.

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