cargo fmt

This commit is contained in:
Dante Pippi 2021-04-27 14:44:09 -03:00
parent 1a84c5f4ec
commit 6769627c36
3 changed files with 12 additions and 19 deletions

View file

@ -596,22 +596,18 @@ impl Tab {
} }
pub fn write_to_terminals_on_current_tab(&mut self, input_bytes: Vec<u8>) { pub fn write_to_terminals_on_current_tab(&mut self, input_bytes: Vec<u8>) {
let pane_ids = self.get_pane_ids(); let pane_ids = self.get_pane_ids();
pane_ids.iter().for_each(|pane_id| { pane_ids.iter().for_each(|pane_id| match pane_id {
match pane_id { PaneId::Terminal(pid) => {
PaneId::Terminal(pid) => { self.write_to_pane_id(input_bytes.clone(), *pid);
self.write_to_pane_id(input_bytes.clone(), *pid);
}
PaneId::Plugin(_) => {}
} }
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 self.os_api
.write_to_tty_stdin(pid, &mut input_bytes) .write_to_tty_stdin(pid, &mut input_bytes)
.expect("failed to write to terminal"); .expect("failed to write to terminal");
self.os_api self.os_api.tcdrain(pid).expect("failed to drain terminal");
.tcdrain(pid)
.expect("failed to drain terminal");
} }
pub fn write_to_active_terminal(&mut self, input_bytes: Vec<u8>) { pub fn write_to_active_terminal(&mut self, input_bytes: Vec<u8>) {
match self.get_active_pane_id() { match self.get_active_pane_id() {

View file

@ -246,9 +246,8 @@ impl InputHandler {
} }
Action::ToggleActiveSyncPanes => { Action::ToggleActiveSyncPanes => {
self.send_screen_instructions self.send_screen_instructions
.send(ScreenInstruction::ToggleActiveSyncPanes) .send(ScreenInstruction::ToggleActiveSyncPanes)
.unwrap(); .unwrap();
} }
Action::CloseTab => { Action::CloseTab => {
self.command_is_executing.closing_pane(); self.command_is_executing.closing_pane();

View file

@ -323,8 +323,7 @@ pub fn start(mut os_input: Box<dyn OsApi>, opts: CliArgs) {
let active_tab = screen.get_active_tab_mut().unwrap(); let active_tab = screen.get_active_tab_mut().unwrap();
match active_tab.is_sync_panes_active() { match active_tab.is_sync_panes_active() {
true => active_tab.write_to_terminals_on_current_tab(bytes), true => active_tab.write_to_terminals_on_current_tab(bytes),
false => active_tab false => active_tab.write_to_active_terminal(bytes),
.write_to_active_terminal(bytes),
} }
} }
ScreenInstruction::ResizeLeft => { ScreenInstruction::ResizeLeft => {
@ -455,7 +454,6 @@ pub fn start(mut os_input: Box<dyn OsApi>, opts: CliArgs) {
ScreenInstruction::Quit => { ScreenInstruction::Quit => {
break; break;
} }
} }
} }
} }