diff options
author | Aram Drevekenin <aram@poor.dev> | 2022-12-24 15:48:04 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-24 15:48:04 +0100 |
commit | 799fa5de8dfd0b826be0f903796bba48a470127e (patch) | |
tree | 8c202e116b757162cadd0cc350da256b9741e248 | |
parent | 17205793e4cd2da5eb431dacfc87dab574080b5b (diff) |
Floating panes in layouts (#2047)
* work
* tests passing
* tests: floating panes in layouts
* panes(plugins): floating plugins working
* refactor(tab): layout applier
* style(comment): remove outdated
* style(fmt): rustfmt
68 files changed, 2051 insertions, 576 deletions
diff --git a/default-plugins/status-bar/src/second_line.rs b/default-plugins/status-bar/src/second_line.rs index 4422105da..9b2c23fb6 100644 --- a/default-plugins/status-bar/src/second_line.rs +++ b/default-plugins/status-bar/src/second_line.rs @@ -179,7 +179,7 @@ fn get_keys_and_hints(mi: &ModeInfo) -> Vec<(String, String, Vec<Key>)> { vec![ (s("Move focus"), s("Move"), focus_keys), - (s("New"), s("New"), action_key(&km, &[A::NewTab(None, None), TO_NORMAL])), + (s("New"), s("New"), action_key(&km, &[A::NewTab(None, vec![], None), TO_NORMAL])), (s("Close"), s("Close"), action_key(&km, &[A::CloseTab, TO_NORMAL])), (s("Rename"), s("Rename"), action_key(&km, &[A::SwitchToMode(IM::RenameTab), A::TabNameInput(vec![0])])), @@ -253,7 +253,7 @@ fn get_keys_and_hints(mi: &ModeInfo) -> Vec<(String, String, Vec<Key>)> { (s("Split down"), s("Down"), action_key(&km, &[A::NewPane(Some(Dir::Down), None), TO_NORMAL])), (s("Split right"), s("Right"), action_key(&km, &[A::NewPane(Some(Dir::Right), None), TO_NORMAL])), (s("Fullscreen"), s("Fullscreen"), action_key(&km, &[A::ToggleFocusFullscreen, TO_NORMAL])), - (s("New tab"), s("New"), action_key(&km, &[A::NewTab(None, None), TO_NORMAL])), + (s("New tab"), s("New"), action_key(&km, &[A::NewTab(None, vec![], None), TO_NORMAL])), (s("Rename tab"), s("Rename"), action_key(&km, &[A::SwitchToMode(IM::RenameTab), A::TabNameInput(vec![0])])), (s("Previous Tab"), s("Previous"), action_key(&km, &[A::GoToPreviousTab, TO_NORMAL])), diff --git a/zellij-server/src/lib.rs b/zellij-server/src/lib.rs index 40c2edc2f..bae871f44 100644 --- a/zellij-server/src/lib.rs +++ b/zellij-server/src/lib.rs @@ -332,7 +332,7 @@ pub fn start_server(mut os_input: Box<dyn ServerOsApi>, socket_path: PathBuf) { }) }); - let spawn_tabs = |tab_layout, tab_name| { + let spawn_tabs = |tab_layout, floating_panes_layout, tab_name| { session_data .read() .unwrap() @@ -342,6 +342,7 @@ pub fn start_server(mut os_input: Box<dyn ServerOsApi>, socket_path: PathBuf) { .send_to_screen(ScreenInstruction::NewTab( default_shell.clone(), tab_layout, + floating_panes_layout, tab_name, client_id, )) @@ -349,8 +350,12 @@ pub fn start_server(mut os_input: Box<dyn ServerOsApi>, socket_path: PathBuf) { }; if layout.has_tabs() { - for (tab_name, tab_layout) in layout.tabs() { - spawn_tabs(Some(tab_layout.clone()), tab_name); + for (tab_name, tab_layout, floating_panes_layout) in layout.tabs() { + spawn_tabs( + Some(tab_layout.clone()), + floating_panes_layout.clone(), + tab_name, + ); } if let Some(focused_tab_index) = layout.focused_tab_index() { @@ -367,7 +372,7 @@ pub fn start_server(mut os_input: Box<dyn ServerOsApi>, socket_path: PathBuf) { |