aboutsummaryrefslogtreecommitdiffstats
path: root/src/client/tab.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/client/tab.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/client/tab.rs')
-rw-r--r--src/client/tab.rs13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/client/tab.rs b/src/client/tab.rs
index 1a3f411d..b74c2eb7 100644
--- a/src/client/tab.rs
+++ b/src/client/tab.rs
@@ -1,6 +1,7 @@
//! `Tab`s holds multiple panes. It tracks their coordinates (x/y) and size,
//! as well as how they should be resized
+use crate::boundaries::colors;
use crate::common::{input::handler::parse_keys, AppInstruction, SenderWithContext};
use crate::layout::Layout;
use crate::panes::{PaneId, PositionAndSize, TerminalPane};
@@ -14,7 +15,7 @@ use std::{
collections::{BTreeMap, HashSet},
};
use std::{io::Write, sync::mpsc::channel};
-use zellij_tile::data::Event;
+use zellij_tile::data::{Event, InputMode};
const CURSOR_HEIGHT_WIDTH_RATIO: usize = 4; // this is not accurate and kind of a magic number, TODO: look into this
const MIN_TERMINAL_HEIGHT: usize = 2;
@@ -65,6 +66,7 @@ pub struct Tab {
pub send_plugin_instructions: SenderWithContext<PluginInstruction>,
pub send_app_instructions: SenderWithContext<AppInstruction>,
expansion_boundary: Option<PositionAndSize>,
+ pub input_mode: InputMode,
}
// FIXME: Use a struct that has a pane_type enum, to reduce all of the duplication
@@ -181,6 +183,7 @@ impl Tab {
send_app_instructions: SenderWithContext<AppInstruction>,
max_panes: Option<usize>,
pane_id: Option<PaneId>,
+ input_mode: InputMode,
) -> Self {
let panes = if let Some(PaneId::Terminal(pid)) = pane_id {
let new_terminal = TerminalPane::new(pid, *full_screen_ws);
@@ -210,6 +213,7 @@ impl Tab {
send_pty_instructions,
send_plugin_instructions,
expansion_boundary: None,
+ input_mode,
}
}
@@ -636,7 +640,12 @@ impl Tab {
.expect("cannot write to stdout");
for (kind, terminal) in self.panes.iter_mut() {
if !self.panes_to_hide.contains(&terminal.pid()) {
- boundaries.add_rect(terminal.as_ref());
+ match self.active_terminal.unwrap() == terminal.pid() {
+ true => {
+ boundaries.add_rect(terminal.as_ref(), self.input_mode, Some(colors::GREEN))
+ }
+ false => boundaries.add_rect(terminal.as_ref(), self.input_mode, None),
+ }
if let Some(vte_output) = terminal.render() {
let vte_output = if let PaneId::Terminal(_) = kind {
vte_output