diff options
| author | Brooks J Rady <b.j.rady@gmail.com> | 2021-03-25 15:51:39 +0000 |
|---|---|---|
| committer | Brooks J Rady <b.j.rady@gmail.com> | 2021-03-25 15:51:39 +0000 |
| commit | 84a5cf95d1168db47931f81774e1210e1f022a69 (patch) | |
| tree | 9060e6e63e5958e6979807da310e61090492da13 /src/common/mod.rs | |
| parent | Removed AppState and the unneeded get_help() function (diff) | |
| download | sl0ppij-84a5cf95d1168db47931f81774e1210e1f022a69.tar.gz sl0ppij-84a5cf95d1168db47931f81774e1210e1f022a69.tar.xz sl0ppij-84a5cf95d1168db47931f81774e1210e1f022a69.zip | |
Converted tab updates to the new generic update() function
Diffstat (limited to 'src/common/mod.rs')
| -rw-r--r-- | src/common/mod.rs | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/src/common/mod.rs b/src/common/mod.rs index f291eb19..15a28d96 100644 --- a/src/common/mod.rs +++ b/src/common/mod.rs @@ -524,7 +524,7 @@ pub fn start(mut os_input: Box<dyn OsApi>, opts: CliArgs) { let subs = plugin_env.subscriptions.lock().unwrap(); // FIXME: This is very janky... Maybe I should write my own macro for Event -> EventType? let event_type = EventType::from_str(&event.to_string()).unwrap(); - if pid.is_none() || pid == Some(i) && subs.contains(&event_type) { + if (pid.is_none() || pid == Some(i)) && subs.contains(&event_type) { let update = instance.exports.get_function("update").unwrap(); wasi_write_string( &plugin_env.wasi_env, @@ -546,20 +546,6 @@ pub fn start(mut os_input: Box<dyn OsApi>, opts: CliArgs) { buf_tx.send(wasi_stdout(&plugin_env.wasi_env)).unwrap(); } - PluginInstruction::UpdateTabs(mut tabs) => { - for (instance, plugin_env) in plugin_map.values() { - if !plugin_env.events.contains(&NaughtyEventType::Tab) { - continue; - } - let handler = instance.exports.get_function("update_tabs").unwrap(); - tabs.sort_by(|a, b| a.position.cmp(&b.position)); - wasi_write_string( - &plugin_env.wasi_env, - &serde_json::to_string(&tabs).unwrap(), - ); - handler.call(&[]).unwrap(); - } - } // FIXME: Deduplicate this with the callback below! PluginInstruction::Input(input_type, input_bytes) => { let PluginInputType::Event(event) = input_type; |
