Skip to content

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