-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
SPC TAB
alternate-buffer-in-persp is broken
#5129
Comments
Why is the expected buffer On Thu, Feb 18, 2016 at 2:13 PM Sylvain Benner notifications@github.com
|
Say I have buffer A, B and C (opened in this order) in window 1 and D, E, F in windows 2. |
this would not work with perspectives... :( On Thu, Feb 18, 2016 at 11:56 PM Sylvain Benner notifications@github.com
|
It looks like Calling |
Honestly I prefer it to be like this, the other implementation is even more confusing when using multiple layouts (like no isolation at all). |
Right I misread the intent of your original issue :) I didn't realize that the alternate buffer is per-window, that's certainly very useful. But (defun spacemacs/alternate-buffer ()
(interactive)
(let* ((current (current-buffer))
(other (if (evil-alternate-buffer)
(car (evil-alternate-buffer))
(other-buffer (current-buffer) t)))
(other (if (persp-contain-buffer-p other)
other
(car (delq current (persp-buffer-list))))))
(if other
(switch-to-buffer other)
(spacemacs/switch-to-scratch-buffer)))) i.e. if the target buffer does not belong to the current perspective, switch to the first buffer of that perspective that is not the current one, and always fall back to the scratch buffer. |
Interesting, let me try this a little while, thank you. |
@toupeira It is not working :-( Reproduction guide 🪲
Observed behaviour: 💔 *Expected behaviour: 💜 |
@syl20bnr I get the same behaviour with the old Isn't the default layout 1 special, in that all buffers are always members of it? That's why |
ooooh nice catch, I'll test later with 2 and 3. |
any status on this? |
@agzam try my workaround above, haven't encountered any issues with it so far. @syl20bnr I'd be happy to submit it in a PR if you think it's an acceptable solution, I'm still pretty new to Emacs so I might be missing something :) |
@agzam
Currently, the second category includes all non-REPL buffers that have "*" in their name. It might be your case as well. I opened an issue to discuss those two variables in #6683 (though it has very few comments), you're welcome to suggest improvements. |
@syl20bnr regarding #5129 (comment), persp-mode's predicate doesn't update immediately when switching layouts (the predicate is byte-compiled on the fly with the current perspective). It could have a delay of ~2 seconds (at least that's what I saw about a month ago), so that's also something to consider in your recipe. |
Nice work @bmag, looks like it is fixed, at least the repro steps are now all good. |
Closing it as it is a 0.200 milestone issue. |
Description
SPC TAB
to go to back and forth to last buffer is broken.Reproduction guide
SPC f e i
SPC w V
SPC f f core/core-funcs.el RET
SPC 1
SPC f f core/core-debug.el RET
SPC 2
SPC TAB
Observed behaviour:
The displayed buffer is
core-debug.el
Expected behaviour:
The displayed buffer should be
init.el
System Info
cc @CestDiego
The text was updated successfully, but these errors were encountered: