Commit 2d3a5f1c authored by Troels Henriksen's avatar Troels Henriksen
Browse files

Make defaults for view-switching slightly nicer.

parent 63cae2d0
......@@ -137,7 +137,9 @@ Signals and error if the file does not exist."
;;; Buffer commands
(define-command (com-switch-to-view :name t :command-table pane-table)
((view 'view :default (or (second (views *application-frame*))
;; Perhaps the default should be an undisplayed view?
((view 'view :default (or (find (current-view) (views *application-frame*)
:test (complement #'eq))
(any-view))))
"Prompt for a buffer name and switch to that buffer.
If the a buffer with that name does not exist, create it. Uses
......
......@@ -137,6 +137,11 @@ window"))
(cancel ()
:report "Cancel the setting of the windows view and just return nil")))
(t (call-next-method)))
;; Move view to the front of the view-list, doesn't carry
;; semantic significance, but makes view-switching more
;; convenient.
(setf (views (pane-frame pane))
(cons view (delete view (views (pane-frame pane)))))
(when old-view-active
(ensure-only-view-active (pane-frame pane) view)))))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment