aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/input
diff options
context:
space:
mode:
authora-kenji <aks.kenji@protonmail.com>2021-05-12 15:46:17 +0200
committerGitHub <noreply@github.com>2021-05-12 15:46:17 +0200
commit9eea63f83615ae73508c8e88e37389390d3946f8 (patch)
tree53533d8553d760b6510d54bbdd80b900346ff987 /src/common/input
parentdocs(changelog): pasted text fix (diff)
parentMerge branch 'main' of https://github.com/zellij-org/zellij into fix-simplifi... (diff)
downloadsl0ppij-9eea63f83615ae73508c8e88e37389390d3946f8.tar.gz
sl0ppij-9eea63f83615ae73508c8e88e37389390d3946f8.tar.xz
sl0ppij-9eea63f83615ae73508c8e88e37389390d3946f8.zip
Merge pull request #495 from a-kenji/fix-simplified-ui
Fix Simplified Ui
Diffstat (limited to 'src/common/input')
-rw-r--r--src/common/input/handler.rs7
-rw-r--r--src/common/input/options.rs22
2 files changed, 7 insertions, 22 deletions
diff --git a/src/common/input/handler.rs b/src/common/input/handler.rs
index 62e2e909..2dbec080 100644
--- a/src/common/input/handler.rs
+++ b/src/common/input/handler.rs
@@ -165,9 +165,12 @@ impl InputHandler {
/// Creates a [`Help`] struct indicating the current [`InputMode`] and its keybinds
/// (as pairs of [`String`]s).
// TODO this should probably be automatically generated in some way
-pub fn get_mode_info(mode: InputMode, palette: Palette) -> ModeInfo {
+pub fn get_mode_info(
+ mode: InputMode,
+ palette: Palette,
+ capabilities: PluginCapabilities,
+) -> ModeInfo {
let mut keybinds: Vec<(String, String)> = vec![];
- let capabilities = PluginCapabilities { arrow_fonts: true };
match mode {
InputMode::Normal | InputMode::Locked => {}
InputMode::Resize => {
diff --git a/src/common/input/options.rs b/src/common/input/options.rs
index 3bd3fc31..33625b65 100644
--- a/src/common/input/options.rs
+++ b/src/common/input/options.rs
@@ -6,18 +6,10 @@ use structopt::StructOpt;
#[derive(Clone, Default, Debug, PartialEq, Deserialize, Serialize, StructOpt)]
/// Options that can be set either through the config file,
/// or cli flags
-/// intermediate struct
pub struct Options {
/// Allow plugins to use a more simplified layout
/// that is compatible with more fonts
#[structopt(long)]
- pub simplified_ui: Option<bool>,
-}
-
-#[derive(Clone, Default, Debug, PartialEq, Deserialize, Serialize)]
-/// Merged version of the [`Options`] struct
-// TODO: Maybe a good candidate for a macro?
-pub struct ConfigOptions {
pub simplified_ui: bool,
}
@@ -34,8 +26,8 @@ impl Options {
/// will supercede a `Some` in `self`
// TODO: Maybe a good candidate for a macro?
pub fn merge(&self, other: Options) -> Options {
- let simplified_ui = if let Some(bool) = other.simplified_ui {
- Some(bool)
+ let simplified_ui = if other.simplified_ui {
+ true
} else {
self.simplified_ui
};
@@ -51,13 +43,3 @@ impl Options {
}
}
}
-
-impl From<Options> for ConfigOptions {
- fn from(options: Options) -> ConfigOptions {
- let simplified_ui = options.simplified_ui;
-
- ConfigOptions {
- simplified_ui: simplified_ui.unwrap_or_default(),
- }
- }
-}