add support for handling cloned indirect buffers #129
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, if a user clones a buffer (with e.g., 'clone-indirect-buffer'), the
new clone will not be added to the current perspective.
This can be a little surprising: suppose I'm working on buffer native.txt in my current perspective and I call
clone-indirect-buffer
. I'll now havenative.txt<2>
displayed, but it is not in the current perspective.I think the most reasonable behavior is for persp-mode to automatically add freshly cloned indirect buffers to the current workspace if the base-buffer is already in the current perspective (e.g.., if you are temporarily displaying buffer
foreign.txt
and then clone it, the new cloneforeig.txt<2>
probably should respect your wishes and not add itself to the current workspace).However, I appreciate that users will have different tastes, so I've added a new customization option so they can restore the old behavior (nil), use what I think is the most natural behavior (t, the new default), or can set it to ('always') so that cloning always adds the newly cloned indirect buffer to the current perspective regardless of whether the base-buffer is a member or not.
I'm open to changing the default to nil, which would retain the "old" behavior and avoid annoying anyone that was relying on it, but I suspect there aren't many people who clone buffers that do not want them added to the current workspace.