aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/errors.rs
diff options
context:
space:
mode:
authora-kenji <aks.kenji@protonmail.com>2021-03-26 23:33:36 +0100
committera-kenji <aks.kenji@protonmail.com>2021-03-26 23:33:36 +0100
commit84488a35aa2cef3505e9b40f7f0345cff73d62c8 (patch)
tree880d5019c40675177ea0402a186f6826d2bffa6f /src/common/errors.rs
parentConfig: Fix README (diff)
parentfeat(plugin): refactored to a new and more general plugin API (diff)
downloadsl0ppij-84488a35aa2cef3505e9b40f7f0345cff73d62c8.tar.gz
sl0ppij-84488a35aa2cef3505e9b40f7f0345cff73d62c8.tar.xz
sl0ppij-84488a35aa2cef3505e9b40f7f0345cff73d62c8.zip
Merge branch 'main' of https://github.com/zellij-org/zellij into config-file
Diffstat (limited to 'src/common/errors.rs')
-rw-r--r--src/common/errors.rs24
1 files changed, 10 insertions, 14 deletions
diff --git a/src/common/errors.rs b/src/common/errors.rs
index df741629..f5aeae85 100644
--- a/src/common/errors.rs
+++ b/src/common/errors.rs
@@ -133,7 +133,7 @@ pub enum ContextType {
Plugin(PluginContext),
/// An app-related call.
App(AppContext),
- IPCServer,
+ IpcServer,
StdinHandler,
AsyncTask,
/// An empty, placeholder call. This should be thought of as representing no call at all.
@@ -152,7 +152,7 @@ impl Display for ContextType {
ContextType::Plugin(c) => write!(f, "{}plugin_thread: {}{:?}", purple, green, c),
ContextType::App(c) => write!(f, "{}main_thread: {}{:?}", purple, green, c),
- ContextType::IPCServer => write!(f, "{}ipc_server: {}AcceptInput", purple, green),
+ ContextType::IpcServer => write!(f, "{}ipc_server: {}AcceptInput", purple, green),
ContextType::StdinHandler => {
write!(f, "{}stdin_handler_thread: {}AcceptInput", purple, green)
}
@@ -164,6 +164,7 @@ impl Display for ContextType {
}
}
+// FIXME: Just deriving EnumDiscriminants from strum will remove the need for any of this!!!
/// Stack call representations corresponding to the different types of [`ScreenInstruction`]s.
#[derive(Debug, Clone, Copy, PartialEq)]
pub enum ScreenContext {
@@ -199,8 +200,10 @@ pub enum ScreenContext {
CloseTab,
GoToTab,
UpdateTabName,
+ ChangeInputMode,
}
+// FIXME: Just deriving EnumDiscriminants from strum will remove the need for any of this!!!
impl From<&ScreenInstruction> for ScreenContext {
fn from(screen_instruction: &ScreenInstruction) -> Self {
match *screen_instruction {
@@ -238,6 +241,7 @@ impl From<&ScreenInstruction> for ScreenContext {
ScreenInstruction::CloseTab => ScreenContext::CloseTab,
ScreenInstruction::GoToTab(_) => ScreenContext::GoToTab,
ScreenInstruction::UpdateTabName(_) => ScreenContext::UpdateTabName,
+ ScreenInstruction::ChangeInputMode(_) => ScreenContext::ChangeInputMode,
}
}
}
@@ -276,24 +280,20 @@ use crate::wasm_vm::PluginInstruction;
#[derive(Debug, Clone, Copy, PartialEq)]
pub enum PluginContext {
Load,
- Draw,
- Input,
- GlobalInput,
+ Update,
+ Render,
Unload,
Quit,
- Tabs,
}
impl From<&PluginInstruction> for PluginContext {
fn from(plugin_instruction: &PluginInstruction) -> Self {
match *plugin_instruction {
PluginInstruction::Load(..) => PluginContext::Load,
- PluginInstruction::Draw(..) => PluginContext::Draw,
- PluginInstruction::Input(..) => PluginContext::Input,
- PluginInstruction::GlobalInput(_) => PluginContext::GlobalInput,
+ PluginInstruction::Update(..) => PluginContext::Update,
+ PluginInstruction::Render(..) => PluginContext::Render,
PluginInstruction::Unload(_) => PluginContext::Unload,
PluginInstruction::Quit => PluginContext::Quit,
- PluginInstruction::UpdateTabs(..) => PluginContext::Tabs,
}
}
}
@@ -301,8 +301,6 @@ impl From<&PluginInstruction> for PluginContext {
/// Stack call representations corresponding to the different types of [`AppInstruction`]s.
#[derive(Debug, Clone, Copy, PartialEq)]
pub enum AppContext {
- GetState,
- SetState,
Exit,
Error,
}
@@ -310,8 +308,6 @@ pub enum AppContext {
impl From<&AppInstruction> for AppContext {
fn from(app_instruction: &AppInstruction) -> Self {
match *app_instruction {
- AppInstruction::GetState(_) => AppContext::GetState,
- AppInstruction::SetState(_) => AppContext::SetState,
AppInstruction::Exit => AppContext::Exit,
AppInstruction::Error(_) => AppContext::Error,
}