aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/screen.rs
diff options
context:
space:
mode:
authorBrooks J Rady <b.j.rady@gmail.com>2021-03-25 14:24:11 +0000
committerBrooks J Rady <b.j.rady@gmail.com>2021-03-25 14:24:11 +0000
commitf2f77583848bce219fc098508fffde30fa366b89 (patch)
tree391ac6129ddcc6ea0fe760dd206abaa97bde3b35 /src/common/screen.rs
parentRemove a dead input enum variant (diff)
parentfix(render): various rendering issues (#238) (diff)
downloadsl0ppij-f2f77583848bce219fc098508fffde30fa366b89.tar.gz
sl0ppij-f2f77583848bce219fc098508fffde30fa366b89.tar.xz
sl0ppij-f2f77583848bce219fc098508fffde30fa366b89.zip
Merge in changes from main and fix clippy lints
Diffstat (limited to 'src/common/screen.rs')
-rw-r--r--src/common/screen.rs14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/common/screen.rs b/src/common/screen.rs
index 57d893c9..89205f73 100644
--- a/src/common/screen.rs
+++ b/src/common/screen.rs
@@ -13,7 +13,7 @@ use crate::tab::Tab;
use crate::{errors::ErrorContext, wasm_vm::PluginInstruction};
use crate::{layout::Layout, panes::PaneId};
-use zellij_tile::data::TabInfo;
+use zellij_tile::data::{InputMode, TabInfo};
/// Instructions that can be sent to the [`Screen`].
#[derive(Debug, Clone)]
@@ -50,6 +50,7 @@ pub enum ScreenInstruction {
CloseTab,
GoToTab(u32),
UpdateTabName(Vec<u8>),
+ ChangeInputMode(InputMode),
}
/// A [`Screen`] holds multiple [`Tab`]s, each one holding multiple [`panes`](crate::client::panes).
@@ -74,6 +75,7 @@ pub struct Screen {
/// The [`OsApi`] this [`Screen`] uses.
os_api: Box<dyn OsApi>,
tabname_buf: String,
+ input_mode: InputMode,
}
impl Screen {
@@ -86,6 +88,7 @@ impl Screen {
full_screen_ws: &PositionAndSize,
os_api: Box<dyn OsApi>,
max_panes: Option<usize>,
+ input_mode: InputMode,
) -> Self {
Screen {
receiver: receive_screen_instructions,
@@ -98,6 +101,7 @@ impl Screen {
tabs: BTreeMap::new(),
os_api,
tabname_buf: String::new(),
+ input_mode,
}
}
@@ -117,6 +121,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);
@@ -258,6 +263,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);
@@ -302,4 +308,10 @@ 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;
+ }
+ }
}