aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authordenis <denismaximov98@gmail.com>2021-03-21 10:48:21 +0200
committerdenis <denismaximov98@gmail.com>2021-03-21 10:48:21 +0200
commit99c578ea1d23f12e2b13f43b562406ccd4120802 (patch)
treee34d686b12671b977cb30d4ab5286a5b8117e728 /src
parentwip: cleanup (diff)
downloadsl0ppij-99c578ea1d23f12e2b13f43b562406ccd4120802.tar.gz
sl0ppij-99c578ea1d23f12e2b13f43b562406ccd4120802.tar.xz
sl0ppij-99c578ea1d23f12e2b13f43b562406ccd4120802.zip
chore: formatting
Diffstat (limited to 'src')
-rw-r--r--src/client/tab.rs20
-rw-r--r--src/common/errors.rs4
-rw-r--r--src/common/mod.rs4
-rw-r--r--src/common/screen.rs16
4 files changed, 18 insertions, 26 deletions
diff --git a/src/client/tab.rs b/src/client/tab.rs
index 67c4540b..8a515279 100644
--- a/src/client/tab.rs
+++ b/src/client/tab.rs
@@ -65,7 +65,7 @@ pub struct Tab {
pub send_plugin_instructions: SenderWithContext<PluginInstruction>,
pub send_app_instructions: SenderWithContext<AppInstruction>,
expansion_boundary: Option<PositionAndSize>,
- pub input_mode: InputMode
+ pub input_mode: InputMode,
}
#[derive(Clone, Debug, Default, Serialize, Deserialize)]
@@ -74,7 +74,7 @@ pub struct TabData {
pub position: usize,
pub name: String,
pub active: bool,
- pub input_mode: InputMode
+ pub input_mode: InputMode,
}
// FIXME: Use a struct that has a pane_type enum, to reduce all of the duplication
@@ -194,7 +194,7 @@ impl Tab {
send_app_instructions: SenderWithContext<AppInstruction>,
max_panes: Option<usize>,
pane_id: Option<PaneId>,
- input_mode: InputMode
+ input_mode: InputMode,
) -> Self {
let panes = if let Some(PaneId::Terminal(pid)) = pane_id {
let new_terminal = TerminalPane::new(pid, *full_screen_ws);
@@ -224,7 +224,7 @@ impl Tab {
send_pty_instructions,
send_plugin_instructions,
expansion_boundary: None,
- input_mode
+ input_mode,
}
}
@@ -654,16 +654,8 @@ impl Tab {
for (kind, terminal) in self.panes.iter_mut() {
if !self.panes_to_hide.contains(&terminal.pid()) {
match self.active_terminal.unwrap() == terminal.pid() {
- true => boundaries.add_rect(
- terminal.as_ref(),
- true,
- self.input_mode
- ),
- false => boundaries.add_rect(
- terminal.as_ref(),
- false,
- self.input_mode
- ),
+ true => boundaries.add_rect(terminal.as_ref(), true, self.input_mode),
+ false => boundaries.add_rect(terminal.as_ref(), false, self.input_mode),
}
if let Some(vte_output) = terminal.render() {
let vte_output = if let PaneId::Terminal(_) = kind {
diff --git a/src/common/errors.rs b/src/common/errors.rs
index a2e05e30..eeebf93f 100644
--- a/src/common/errors.rs
+++ b/src/common/errors.rs
@@ -199,7 +199,7 @@ pub enum ScreenContext {
CloseTab,
GoToTab,
UpdateTabName,
- ChangeInputMode
+ ChangeInputMode,
}
impl From<&ScreenInstruction> for ScreenContext {
@@ -239,7 +239,7 @@ impl From<&ScreenInstruction> for ScreenContext {
ScreenInstruction::CloseTab => ScreenContext::CloseTab,
ScreenInstruction::GoToTab(_) => ScreenContext::GoToTab,
ScreenInstruction::UpdateTabName(_) => ScreenContext::UpdateTabName,
- ScreenInstruction::ChangeInputMode(_) => ScreenContext::ChangeInputMode
+ ScreenInstruction::ChangeInputMode(_) => ScreenContext::ChangeInputMode,
}
}
}
diff --git a/src/common/mod.rs b/src/common/mod.rs
index 3b596f42..d52b5a4c 100644
--- a/src/common/mod.rs
+++ b/src/common/mod.rs
@@ -26,6 +26,7 @@ use wasmer::{ChainableNamedResolver, Instance, Module, Store, Value};
use wasmer_wasi::{Pipe, WasiState};
use crate::cli::CliArgs;
+use crate::common::utils::logging::debug_log_to_file;
use crate::layout::Layout;
use command_is_executing::CommandIsExecuting;
use errors::{AppContext, ContextType, ErrorContext, PluginContext, PtyContext, ScreenContext};
@@ -37,7 +38,6 @@ use utils::consts::{ZELLIJ_IPC_PIPE, ZELLIJ_ROOT_PLUGIN_DIR};
use wasm_vm::{
wasi_stdout, wasi_write_string, zellij_imports, EventType, PluginInputType, PluginInstruction,
};
-use crate::common::utils::logging::debug_log_to_file;
#[derive(Serialize, Deserialize, Debug)]
pub enum ApiCommand {
@@ -291,7 +291,7 @@ pub fn start(mut os_input: Box<dyn OsApi>, opts: CliArgs) {
&full_screen_ws,
os_input,
max_panes,
- InputMode::Normal
+ InputMode::Normal,
);
loop {
let (event, mut err_ctx) = screen
diff --git a/src/common/screen.rs b/src/common/screen.rs
index eb8e3eb2..d40a80c6 100644
--- a/src/common/screen.rs
+++ b/src/common/screen.rs
@@ -5,7 +5,7 @@ use std::os::unix::io::RawFd;
use std::str;
use std::sync::mpsc::Receiver;
-use super::{AppInstruction, SenderWithContext, input::handler::InputMode};
+use super::{input::handler::InputMode, AppInstruction, SenderWithContext};
use crate::os_input_output::OsApi;
use crate::panes::PositionAndSize;
use crate::pty_bus::{PtyInstruction, VteEvent};
@@ -48,7 +48,7 @@ pub enum ScreenInstruction {
CloseTab,
GoToTab(u32),
UpdateTabName(Vec<u8>),
- ChangeInputMode(InputMode)
+ ChangeInputMode(InputMode),
}
/// A [`Screen`] holds multiple [`Tab`]s, each one holding multiple [`panes`](crate::client::panes).
@@ -73,7 +73,7 @@ pub struct Screen {
/// The [`OsApi`] this [`Screen`] uses.
os_api: Box<dyn OsApi>,
tabname_buf: String,
- input_mode: InputMode
+ input_mode: InputMode,
}
impl Screen {
@@ -86,7 +86,7 @@ impl Screen {
full_screen_ws: &PositionAndSize,
os_api: Box<dyn OsApi>,
max_panes: Option<usize>,
- input_mode: InputMode
+ input_mode: InputMode,
) -> Self {
Screen {
receiver: receive_screen_instructions,
@@ -99,7 +99,7 @@ impl Screen {
tabs: BTreeMap::new(),
os_api,
tabname_buf: String::new(),
- input_mode
+ input_mode,
}
}
@@ -119,7 +119,7 @@ impl Screen {
self.send_app_instructions.clone(),
self.max_panes,
Some(PaneId::Terminal(pane_id)),
- self.input_mode
+ self.input_mode,
);
self.active_tab_index = Some(tab_index);
self.tabs.insert(tab_index, tab);
@@ -264,7 +264,7 @@ impl Screen {
self.send_app_instructions.clone(),
self.max_panes,
None,
- self.input_mode
+ self.input_mode,
);
tab.apply_layout(layout, new_pids);
self.active_tab_index = Some(tab_index);
@@ -280,7 +280,7 @@ impl Screen {
position: tab.position,
name: tab.name.clone(),
active: active_tab_index == tab.index,
- input_mode: self.input_mode
+ input_mode: self.input_mode,
});
}
self.send_plugin_instructions