From 732ab313e6d58792e49198ddd5feac108e97a36b Mon Sep 17 00:00:00 2001 From: Daniel Alejandro Tapia Date: Sat, 28 Dec 2024 04:23:06 -0500 Subject: [PATCH] only change recent frame list when switch target is different only change recent frame list when switch target is different. i find this to be very helpful because sometimes i choose the same frame either through a command or by accident, and then `frame-multiplexer-recent` becomes useless. with this change, `frame-multiplexer-recent` will continue to be useful even after a mitake or a redundant switch for example : i run a command that always opens a file in frame 1. so i run the command a few times (maybe while changing buffers on the same frame), and now when i do `frame-multiplexer-recent`, it is useless. with this patch, `frame-multiplexer-recent` will continue to be useful in such situations --- src/ext/frame-multiplexer.lisp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/ext/frame-multiplexer.lisp b/src/ext/frame-multiplexer.lisp index 51f548ee6..b2a8edd23 100644 --- a/src/ext/frame-multiplexer.lisp +++ b/src/ext/frame-multiplexer.lisp @@ -447,10 +447,12 @@ The prefix argument ID defaults to 1." ;; and asking for the frame name (or buffer of the frame, if it has no name) (check-frame-multiplexer-usable) (let* ((vf (gethash (implementation) *virtual-frame-map*)) - (entry (aref (virtual-frame-id/frame-table vf) id))) - (if entry - (switch-current-frame vf (frame-table-entry-frame entry)) - (editor-error "No frame with ID ~a" id)))) + (entry (aref (virtual-frame-id/frame-table vf) id)) + (same-frame-p (eq (current-frame) (frame-table-entry-frame entry)))) + (unless same-frame-p + (if entry + (switch-current-frame vf (frame-table-entry-frame entry)) + (editor-error "No frame with ID ~a" id))))) (macrolet ((def (command-name n) `(define-command (,command-name (:advice-classes frame-multiplexer-advice))