aboutsummaryrefslogtreecommitdiffstats
path: root/src/common
diff options
context:
space:
mode:
authordenis <denismaximov98@gmail.com>2021-03-24 11:23:03 +0200
committerdenis <denismaximov98@gmail.com>2021-03-24 11:23:03 +0200
commit57e1f476f2323c4aff0d501d8905752dd6112ebe (patch)
treecf9ceb0c4288f2d811497482c80809d90961ce7f /src/common
parentwip: cleanup the TabData, get rid of input_mode in tab, pass through render i... (diff)
downloadsl0ppij-57e1f476f2323c4aff0d501d8905752dd6112ebe.tar.gz
sl0ppij-57e1f476f2323c4aff0d501d8905752dd6112ebe.tar.xz
sl0ppij-57e1f476f2323c4aff0d501d8905752dd6112ebe.zip
wip: input_mode back in tab, not passing stuff around anymore
Diffstat (limited to 'src/common')
-rw-r--r--src/common/screen.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/common/screen.rs b/src/common/screen.rs
index 1decb739..bb77ab85 100644
--- a/src/common/screen.rs
+++ b/src/common/screen.rs
@@ -119,6 +119,7 @@ impl Screen {
self.send_app_instructions.clone(),
self.max_panes,
Some(PaneId::Terminal(pane_id)),
+ self.input_mode,
);
self.active_tab_index = Some(tab_index);
self.tabs.insert(tab_index, tab);
@@ -217,10 +218,9 @@ impl Screen {
/// Renders this [`Screen`], which amounts to rendering its active [`Tab`].
pub fn render(&mut self) {
- let input_mode = self.input_mode;
if let Some(active_tab) = self.get_active_tab_mut() {
if active_tab.get_active_pane().is_some() {
- active_tab.render(Some(input_mode));
+ active_tab.render();
} else {
self.close_tab();
}
@@ -264,6 +264,7 @@ impl Screen {
self.send_app_instructions.clone(),
self.max_panes,
None,
+ self.input_mode,
);
tab.apply_layout(layout, new_pids);
self.active_tab_index = Some(tab_index);
@@ -310,5 +311,8 @@ impl Screen {
}
pub fn change_input_mode(&mut self, input_mode: InputMode) {
self.input_mode = input_mode;
+ for tab in self.tabs.values_mut() {
+ tab.input_mode = self.input_mode;
+ }
}
}