diff options
| author | denis <denismaximov98@gmail.com> | 2021-03-30 14:17:16 +0300 |
|---|---|---|
| committer | Kunal Mohan <kunalmohan99@gmail.com> | 2021-05-04 20:48:14 +0530 |
| commit | ee14d5f5ddb75ad6062e978e789f234e8dc09858 (patch) | |
| tree | a27f99aefbb036ceafdbce0207e5d599893a42ea /src/client | |
| parent | client side threads should send messages directly to server and router thread... (diff) | |
| download | sl0ppij-ee14d5f5ddb75ad6062e978e789f234e8dc09858.tar.gz sl0ppij-ee14d5f5ddb75ad6062e978e789f234e8dc09858.tar.xz sl0ppij-ee14d5f5ddb75ad6062e978e789f234e8dc09858.zip | |
wip: helper functions for ServerInstruction
Diffstat (limited to 'src/client')
| -rw-r--r-- | src/client/tab.rs | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/client/tab.rs b/src/client/tab.rs index 6fe72131..c285cc0b 100644 --- a/src/client/tab.rs +++ b/src/client/tab.rs @@ -358,8 +358,8 @@ impl Tab { // can query the screen as to how many panes it needs to create a layout // fixing this will require a bit of an architecture change self.os_api - .send_to_server(ServerInstruction::ToPty(PtyInstruction::ClosePane( - PaneId::Terminal(*unused_pid), + .send_to_server(ServerInstruction::pty_close_pane(PaneId::Terminal( + *unused_pid, ))); } self.active_terminal = self.panes.iter().map(|(id, _)| id.to_owned()).next(); @@ -406,7 +406,7 @@ impl Tab { ); if terminal_id_to_split.is_none() { self.os_api - .send_to_server(ServerInstruction::ToPty(PtyInstruction::ClosePane(pid))); // we can't open this pane, close the pty + .send_to_server(ServerInstruction::pty_close_pane(pid)); // we can't open this pane, close the pty return; // likely no terminal large enough to split } let terminal_id_to_split = terminal_id_to_split.unwrap(); @@ -496,7 +496,7 @@ impl Tab { let active_pane = self.panes.get_mut(active_pane_id).unwrap(); if active_pane.rows() < MIN_TERMINAL_HEIGHT * 2 + 1 { self.os_api - .send_to_server(ServerInstruction::ToPty(PtyInstruction::ClosePane(pid))); // we can't open this pane, close the pty + .send_to_server(ServerInstruction::pty_close_pane(pid)); // we can't open this pane, close the pty return; } let terminal_ws = PositionAndSize { @@ -557,7 +557,7 @@ impl Tab { let active_pane = self.panes.get_mut(active_pane_id).unwrap(); if active_pane.columns() < MIN_TERMINAL_WIDTH * 2 + 1 { self.os_api - .send_to_server(ServerInstruction::ToPty(PtyInstruction::ClosePane(pid))); // we can't open this pane, close the pty + .send_to_server(ServerInstruction::pty_close_pane(pid)); // we can't open this pane, close the pty return; } let terminal_ws = PositionAndSize { @@ -2145,7 +2145,7 @@ impl Tab { let terminals = self.get_pane_ids(); for &pid in terminals.iter().skip(max_panes - 1) { self.os_api - .send_to_server(ServerInstruction::ToPty(PtyInstruction::ClosePane(pid))); + .send_to_server(ServerInstruction::pty_close_pane(pid)); self.close_pane_without_rerender(pid); } } @@ -2256,9 +2256,7 @@ impl Tab { if let Some(active_pane_id) = self.get_active_pane_id() { self.close_pane(active_pane_id); self.os_api - .send_to_server(ServerInstruction::ToPty(PtyInstruction::ClosePane( - active_pane_id, - ))); + .send_to_server(ServerInstruction::pty_close_pane(active_pane_id)); } } pub fn scroll_active_terminal_up(&mut self) { |
