fix(plugins): swap layouts and invoked_with (#2564)
This commit is contained in:
parent
0adb10573d
commit
1280cc8d73
5 changed files with 22 additions and 17 deletions
|
|
@ -697,6 +697,7 @@ impl Pane for TerminalPane {
|
|||
self.grid.is_alternate_mode_active()
|
||||
}
|
||||
fn hold(&mut self, exit_status: Option<i32>, is_first_run: bool, run_command: RunCommand) {
|
||||
self.invoked_with = Some(Run::Command(run_command.clone()));
|
||||
self.is_held = Some((exit_status, is_first_run, run_command));
|
||||
if is_first_run {
|
||||
self.render_first_run_banner();
|
||||
|
|
|
|||
|
|
@ -588,21 +588,25 @@ fn host_new_tabs_with_layout(env: &ForeignFunctionEnv) {
|
|||
let mut tabs_to_open = vec![];
|
||||
let tabs = layout.tabs();
|
||||
if tabs.is_empty() {
|
||||
let swap_tiled_layouts = Some(layout.swap_tiled_layouts.clone());
|
||||
let swap_floating_layouts = Some(layout.swap_floating_layouts.clone());
|
||||
let action = Action::NewTab(
|
||||
layout.template.as_ref().map(|t| t.0.clone()),
|
||||
layout.template.map(|t| t.1).unwrap_or_default(),
|
||||
None,
|
||||
None,
|
||||
swap_tiled_layouts,
|
||||
swap_floating_layouts,
|
||||
None,
|
||||
);
|
||||
tabs_to_open.push(action);
|
||||
} else {
|
||||
for (tab_name, tiled_pane_layout, floating_pane_layout) in layout.tabs() {
|
||||
let swap_tiled_layouts = Some(layout.swap_tiled_layouts.clone());
|
||||
let swap_floating_layouts = Some(layout.swap_floating_layouts.clone());
|
||||
let action = Action::NewTab(
|
||||
Some(tiled_pane_layout),
|
||||
floating_pane_layout,
|
||||
None,
|
||||
None,
|
||||
swap_tiled_layouts,
|
||||
swap_floating_layouts,
|
||||
tab_name,
|
||||
);
|
||||
tabs_to_open.push(action);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
source: zellij-server/src/tab/./unit/tab_integration_tests.rs
|
||||
assertion_line: 5402
|
||||
assertion_line: 5926
|
||||
expression: snapshot
|
||||
---
|
||||
00 (C): ┌ status-bar ──────────────────────────────────────────────┐─────────────────────────────────────────────────┐──────────┐
|
||||
|
|
@ -13,11 +13,11 @@ expression: snapshot
|
|||
07 (C): │ │ │ │
|
||||
08 (C): │ │ │ │
|
||||
09 (C): └──────────────────────────────────────────────────────────┘─────────────────────────────────────────────────┘ │
|
||||
10 (C): ┌ command2 ───────────────────│ ┌ command1 ────────────────────────────────────────────────┐ │
|
||||
10 (C): ┌ command1 ───────────────────│ ┌ command2 ────────────────────────────────────────────────┐ │
|
||||
11 (C): │ │ │ │ │
|
||||
12 (C): │ │ │ │ │
|
||||
13 (C): │ │ │ │ │
|
||||
14 (C): │ Waiting to ru└───────────────────│ Waiting to run: command1 │ │
|
||||
14 (C): │ Waiting to ru└───────────────────│ Waiting to run: command2 │ │
|
||||
15 (C): │ │ │ │
|
||||
16 (C): │ <ENTER> to run, <Ctrl-c> to exit │ <ENTER> to run, <Ctrl-c> to exit │ │
|
||||
17 (C): │ │ │ │
|
||||
|
|
|
|||
|
|
@ -1,19 +1,19 @@
|
|||
---
|
||||
source: zellij-server/src/tab/./unit/tab_integration_tests.rs
|
||||
assertion_line: 4689
|
||||
assertion_line: 4992
|
||||
expression: snapshot
|
||||
---
|
||||
00 (C): I am a
|
||||
01 (C): status bar
|
||||
02 (C): ┌ command2 ─────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
||||
02 (C): ┌ command1 ─────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
||||
03 (C): │ │
|
||||
04 (C): │ Waiting to run: command2 │
|
||||
04 (C): │ Waiting to run: command1 │
|
||||
05 (C): │ │
|
||||
06 (C): │ <ENTER> to run, <Ctrl-c> to exit │
|
||||
07 (C): └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
||||
08 (C): ┌ command1 ─────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
||||
08 (C): ┌ command2 ─────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
||||
09 (C): │ │
|
||||
10 (C): │ Waiting to run: command1 │
|
||||
10 (C): │ Waiting to run: command2 │
|
||||
11 (C): │ │
|
||||
12 (C): │ <ENTER> to run, <Ctrl-c> to exit │
|
||||
13 (C): └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
source: zellij-server/src/tab/./unit/tab_integration_tests.rs
|
||||
assertion_line: 5734
|
||||
assertion_line: 6363
|
||||
expression: snapshot
|
||||
---
|
||||
00 (C): ┌ Pane #1 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
||||
|
|
@ -8,10 +8,10 @@ expression: snapshot
|
|||
02 (C): │ │
|
||||
03 (C): │ │
|
||||
04 (C): │ │
|
||||
05 (C): │ ┌ Pane #2 ─────────────────────────────────────────────────┐ │
|
||||
06 (C): │ │ │ │
|
||||
07 (C): │ │ ┌ tab-bar ─────────────────────────────────────────────────┐ │
|
||||
08 (C): │ │ │I am a tab bar │ │
|
||||
05 (C): │ ┌ tab-bar ─────────────────────────────────────────────────┐ │
|
||||
06 (C): │ │I am a tab bar │ │
|
||||
07 (C): │ │ ┌ Pane #2 ─────────────────────────────────────────────────┐ │
|
||||
08 (C): │ │ │ │ │
|
||||
09 (C): │ │ │ ┌ status-bar ──────────────────────────────────────────────┐ │
|
||||
10 (C): │ │ │ │I am a │ │
|
||||
11 (C): │ │ │ │status bar │ │
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue