diff options
| author | Dante Pippi <6619666+dantepippi@users.noreply.github.com> | 2021-04-27 14:44:09 -0300 |
|---|---|---|
| committer | Dante Pippi <6619666+dantepippi@users.noreply.github.com> | 2021-04-28 11:16:06 -0300 |
| commit | 6769627c3677e22a69b9059b1d85b00bd0d29bbb (patch) | |
| tree | fdc6e4edc2806316440c51001af40d9eed350302 /src | |
| parent | New feature: Synchronize text sent to panes (diff) | |
| download | sl0ppij-6769627c3677e22a69b9059b1d85b00bd0d29bbb.tar.gz sl0ppij-6769627c3677e22a69b9059b1d85b00bd0d29bbb.tar.xz sl0ppij-6769627c3677e22a69b9059b1d85b00bd0d29bbb.zip | |
cargo fmt
Diffstat (limited to 'src')
| -rw-r--r-- | src/client/tab.rs | 22 | ||||
| -rw-r--r-- | src/common/input/handler.rs | 5 | ||||
| -rw-r--r-- | src/common/mod.rs | 4 |
3 files changed, 12 insertions, 19 deletions
diff --git a/src/client/tab.rs b/src/client/tab.rs index 23146eba..f9d98ace 100644 --- a/src/client/tab.rs +++ b/src/client/tab.rs @@ -596,22 +596,18 @@ impl Tab { } pub fn write_to_terminals_on_current_tab(&mut self, input_bytes: Vec<u8>) { let pane_ids = self.get_pane_ids(); - pane_ids.iter().for_each(|pane_id| { - match pane_id { - PaneId::Terminal(pid) => { - self.write_to_pane_id(input_bytes.clone(), *pid); - } - PaneId::Plugin(_) => {} + pane_ids.iter().for_each(|pane_id| match pane_id { + PaneId::Terminal(pid) => { + self.write_to_pane_id(input_bytes.clone(), *pid); } - }); + PaneId::Plugin(_) => {} + }); } - pub fn write_to_pane_id(&mut self, mut input_bytes: Vec<u8>, pid:RawFd) { + pub fn write_to_pane_id(&mut self, mut input_bytes: Vec<u8>, pid: RawFd) { self.os_api - .write_to_tty_stdin(pid, &mut input_bytes) - .expect("failed to write to terminal"); - self.os_api - .tcdrain(pid) - .expect("failed to drain terminal"); + .write_to_tty_stdin(pid, &mut input_bytes) + .expect("failed to write to terminal"); + self.os_api.tcdrain(pid).expect("failed to drain terminal"); } pub fn write_to_active_terminal(&mut self, input_bytes: Vec<u8>) { match self.get_active_pane_id() { diff --git a/src/common/input/handler.rs b/src/common/input/handler.rs index fa5268bd..62118722 100644 --- a/src/common/input/handler.rs +++ b/src/common/input/handler.rs @@ -246,9 +246,8 @@ impl InputHandler { } Action::ToggleActiveSyncPanes => { self.send_screen_instructions - .send(ScreenInstruction::ToggleActiveSyncPanes) - .unwrap(); - + .send(ScreenInstruction::ToggleActiveSyncPanes) + .unwrap(); } Action::CloseTab => { self.command_is_executing.closing_pane(); diff --git a/src/common/mod.rs b/src/common/mod.rs index f56a1c91..d829451e 100644 --- a/src/common/mod.rs +++ b/src/common/mod.rs @@ -323,8 +323,7 @@ pub fn start(mut os_input: Box<dyn OsApi>, opts: CliArgs) { let active_tab = screen.get_active_tab_mut().unwrap(); match active_tab.is_sync_panes_active() { true => active_tab.write_to_terminals_on_current_tab(bytes), - false => active_tab - .write_to_active_terminal(bytes), + false => active_tab.write_to_active_terminal(bytes), } } ScreenInstruction::ResizeLeft => { @@ -455,7 +454,6 @@ pub fn start(mut os_input: Box<dyn OsApi>, opts: CliArgs) { ScreenInstruction::Quit => { break; } - } } } |
