File tree Expand file tree Collapse file tree 2 files changed +21
-2
lines changed Expand file tree Collapse file tree 2 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -635,6 +635,13 @@ impl FloatingPanes {
635
635
}
636
636
}
637
637
638
+ pub fn focus_last_pane ( & mut self , client_id : ClientId ) {
639
+ if let Some ( pane_id) = self . active_panes . get_last ( & client_id) . copied ( ) {
640
+ self . focus_pane ( pane_id, client_id) ;
641
+ self . set_force_render ( ) ;
642
+ }
643
+ }
644
+
638
645
pub fn move_active_pane_down ( & mut self , client_id : ClientId ) {
639
646
if let Some ( active_pane_id) = self . active_panes . get ( & client_id) {
640
647
self . move_pane_down ( * active_pane_id) ;
@@ -829,6 +836,11 @@ impl FloatingPanes {
829
836
self . set_force_render ( ) ;
830
837
}
831
838
pub fn focus_pane ( & mut self , pane_id : PaneId , client_id : ClientId ) {
839
+ if let Some ( focused_pane) = self . active_panes . get ( & client_id) {
840
+ if pane_id != * focused_pane {
841
+ self . active_panes . set_last_pane ( client_id, * focused_pane) ;
842
+ }
843
+ }
832
844
let pane_is_selectable = self
833
845
. panes
834
846
. get ( & pane_id)
Original file line number Diff line number Diff line change @@ -3000,7 +3000,10 @@ impl Tab {
3000
3000
if !self . has_selectable_panes ( ) {
3001
3001
return ;
3002
3002
}
3003
- if self . tiled_panes . fullscreen_is_active ( ) {
3003
+ if self . floating_panes . panes_are_visible ( ) {
3004
+ self . floating_panes . focus_last_pane ( client_id) ;
3005
+ }
3006
+ else if self . tiled_panes . fullscreen_is_active ( ) {
3004
3007
self . switch_last_pane_fullscreen ( client_id) ;
3005
3008
return ;
3006
3009
}
@@ -4999,7 +5002,11 @@ impl Tab {
4999
5002
. with_context ( err_context) ?;
5000
5003
self . floating_panes . add_pane ( pane_id, pane) ;
5001
5004
if should_focus_new_pane {
5002
- self . floating_panes . focus_pane_for_all_clients ( pane_id) ;
5005
+ if let Some ( client_id) = client_id {
5006
+ self . floating_panes . focus_pane ( pane_id, client_id) ;
5007
+ } else {
5008
+ self . floating_panes . focus_pane_for_all_clients ( pane_id) ;
5009
+ }
5003
5010
}
5004
5011
}
5005
5012
if self . auto_layout && !self . swap_layouts . is_floating_damaged ( ) {
You can’t perform that action at this time.
0 commit comments