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

feature: change worktree on all buffers #93

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

Conversation

Kasama
Copy link

@Kasama Kasama commented Jul 25, 2022

Change update_current_buffer function to update all currently open buffers and de-list buffers from the previous worktree.

Buffers from files that don't exist on another worktree will only be de-listed.

Buffers unrelated to the worktree (temporary or external files) should ignored

The focused buffer file will be kept focused on the new worktree, unless if it doesn't exist, in which case it will select the last one.

In the future, it would also be possible to remember closed files that don't exist for when you switch back, that's not addressed by this PR

Also fixes #84

Change update_current_buffer function to update all currently open buffers and de-list buffers from the previous worktree.

Buffers from files that don't exist on another worktree will only be de-listed.

Buffers unrelated to the worktree (temporary or external files) should ignored

The focused buffer file will be kept focused on the new worktree, unless if it doesn't exist, in which case it will select the last one.

In the future, it would also be possible to remember closed files that don't exist for when you switch back, that's not addressed by this PR

Also fixes ThePrimeagen#84
@Kasama Kasama force-pushed the feature/switch-all-buffers branch from fcef103 to 1fc963d Compare July 25, 2022 04:47
@calebdw
Copy link

calebdw commented Oct 10, 2024

Change update_current_buffer function to update all currently open buffers

I don't care for this change, at least if it's forced 100% of the time. It is very useful to be able to open a split and compare the same files across branches, this change would not allow you to do this.

I do understand where the motivation for this is coming from, so perhaps there could be an option / different keypress to change all buffers vs. only changing the current 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.

BUG? - :bnext and :bprevious takes you to file on previous worktree
2 participants