aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--perspective.el6
1 files changed, 5 insertions, 1 deletions
diff --git a/perspective.el b/perspective.el
index 0bf194f..a2330cc 100644
--- a/perspective.el
+++ b/perspective.el
@@ -1259,7 +1259,11 @@ PERSP-SET-IDO-BUFFERS)."
(append
(list
(format "Switch to buffer (%s): " (persp-current-name))
- (cl-remove-if #'null (mapcar #'buffer-name (persp-current-buffers)))
+ (cl-remove-if #'null (mapcar #'buffer-name
+ ;; buffer-list is ordered by access time
+ ;; seq-intersection keeps the order
+ (seq-intersection (buffer-list)
+ (persp-current-buffers))))
:preselect (buffer-name (persp-other-buffer (current-buffer)))
:keymap ivy-switch-buffer-map
:caller #'ivy-switch-buffer