aboutsummaryrefslogtreecommitdiffstats
path: root/src/common
diff options
context:
space:
mode:
authorKunal Mohan <kunalmohan99@gmail.com>2021-03-20 01:55:13 +0530
committerKunal Mohan <kunalmohan99@gmail.com>2021-05-04 20:47:51 +0530
commitfd1debaa79da2f03c37c7a92a0e5c0eef490feff (patch)
tree7e898267d56497a7123bf5505f72cdde2d6c18e1 /src/common
parentIntroduce ServerContext (diff)
downloadsl0ppij-fd1debaa79da2f03c37c7a92a0e5c0eef490feff.tar.gz
sl0ppij-fd1debaa79da2f03c37c7a92a0e5c0eef490feff.tar.xz
sl0ppij-fd1debaa79da2f03c37c7a92a0e5c0eef490feff.zip
Fix after rebase
Diffstat (limited to 'src/common')
-rw-r--r--src/common/errors.rs2
-rw-r--r--src/common/mod.rs6
-rw-r--r--src/common/screen.rs2
-rw-r--r--src/common/wasm_vm.rs1
4 files changed, 11 insertions, 0 deletions
diff --git a/src/common/errors.rs b/src/common/errors.rs
index e8e02e5a..234745ad 100644
--- a/src/common/errors.rs
+++ b/src/common/errors.rs
@@ -330,6 +330,7 @@ pub enum PluginContext {
Render,
Unload,
Exit,
+ Tabs,
}
impl From<&PluginInstruction> for PluginContext {
@@ -340,6 +341,7 @@ impl From<&PluginInstruction> for PluginContext {
PluginInstruction::Render(..) => PluginContext::Render,
PluginInstruction::Unload(_) => PluginContext::Unload,
PluginInstruction::Exit => PluginContext::Exit,
+ PluginInstruction::UpdateTabs(..) => PluginContext::Tabs,
}
}
}
diff --git a/src/common/mod.rs b/src/common/mod.rs
index e8883d4f..9554eb78 100644
--- a/src/common/mod.rs
+++ b/src/common/mod.rs
@@ -432,6 +432,12 @@ pub fn start(
screen.apply_layout(Layout::new(layout), new_pane_pids);
command_is_executing.done_opening_new_pane();
}
+ ScreenInstruction::GoToTab(tab_index) => {
+ screen.go_to_tab(tab_index as usize)
+ }
+ ScreenInstruction::UpdateTabName(c) => {
+ screen.update_active_tab_name(c);
+ }
ScreenInstruction::Exit => {
break;
}
diff --git a/src/common/screen.rs b/src/common/screen.rs
index ae1f4dd7..1bc372f6 100644
--- a/src/common/screen.rs
+++ b/src/common/screen.rs
@@ -4,6 +4,7 @@ use serde::{Deserialize, Serialize};
use std::collections::BTreeMap;
use std::os::unix::io::RawFd;
use std::path::PathBuf;
+use std::str;
use std::sync::mpsc::Receiver;
use super::{AppInstruction, SenderWithContext};
@@ -79,6 +80,7 @@ pub struct Screen {
active_tab_index: Option<usize>,
/// The [`OsApi`] this [`Screen`] uses.
os_api: Box<dyn ClientOsApi>,
+ tabname_buf: String,
}
impl Screen {
diff --git a/src/common/wasm_vm.rs b/src/common/wasm_vm.rs
index 31b1000c..d4580572 100644
--- a/src/common/wasm_vm.rs
+++ b/src/common/wasm_vm.rs
@@ -21,6 +21,7 @@ pub enum PluginInstruction {
Update(Option<u32>, Event), // Focused plugin / broadcast, event data
Render(Sender<String>, u32, usize, usize), // String buffer, plugin id, rows, cols
Unload(u32),
+ UpdateTabs(Vec<TabData>), // num tabs, active tab
Exit,
}