aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/mod.rs
diff options
context:
space:
mode:
authorJonah Caplan <jonahcaplan@gmail.com>2021-02-20 18:19:05 -0500
committerJonah Caplan <jonahcaplan@gmail.com>2021-02-25 01:44:10 -0500
commitce54127d7de314e683ed0fefd8be987bbc47e369 (patch)
tree0fd91434af3477f9b7c16a61b822537a18abcca2 /src/common/mod.rs
parentMake fullscreen panes not override the status bar and strider (#209) (diff)
downloadsl0ppij-ce54127d7de314e683ed0fefd8be987bbc47e369.tar.gz
sl0ppij-ce54127d7de314e683ed0fefd8be987bbc47e369.tar.xz
sl0ppij-ce54127d7de314e683ed0fefd8be987bbc47e369.zip
add basic tab bar #166
Diffstat (limited to 'src/common/mod.rs')
-rw-r--r--src/common/mod.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/common/mod.rs b/src/common/mod.rs
index 8f37994f..f78303ea 100644
--- a/src/common/mod.rs
+++ b/src/common/mod.rs
@@ -416,6 +416,9 @@ pub fn start(mut os_input: Box<dyn OsApi>, opts: CliArgs) {
screen.apply_layout(layout, new_pane_pids);
command_is_executing.done_opening_new_pane();
}
+ ScreenInstruction::GoToTab(tab_index) => {
+ screen.go_to_tab(tab_index as usize)
+ }
ScreenInstruction::Quit => {
break;
}
@@ -511,6 +514,17 @@ pub fn start(mut os_input: Box<dyn OsApi>, opts: CliArgs) {
buf_tx.send(wasi_stdout(&plugin_env.wasi_env)).unwrap();
}
+ PluginInstruction::UpdateTabs(active_tab_index, num_tabs) => {
+ for (instance, _) in plugin_map.values() {
+ let handler = instance.exports.get_function("update_tabs").unwrap();
+ handler
+ .call(&[
+ Value::I32(active_tab_index as i32),
+ Value::I32(num_tabs as i32),
+ ])
+ .unwrap();
+ }
+ }
// FIXME: Deduplicate this with the callback below!
PluginInstruction::Input(pid, input_bytes) => {
let (instance, plugin_env) = plugin_map.get(&pid).unwrap();