diff options
author | a-kenji <aks.kenji@protonmail.com> | 2022-03-03 14:08:51 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-03 14:08:51 +0100 |
commit | cd4b8ae8b6db618e1a6e0f037c1f768cec9f1ff7 (patch) | |
tree | da06590e76d0eab18b79f7eaa4252e36be0e7d2f | |
parent | d1c3a367d1c52dc5cecadb39b9907bec4f8bbecc (diff) |
fix(layout): allow lowercase keys and values (#1160)
A layout needed to be specified as follows:
```
---
template:
direction: Horizontal
parts:
- direction: Vertical
body: true
- direction: Vertical
borderless: true
split_size:
Fixed: 1
```
now the same layout can be specified as:
```
---
template:
direction: horizontal
parts:
- direction: vertical
body: true
- direction: vertical
borderless: true
split_size:
fixed: 1
```
-rw-r--r-- | zellij-utils/src/input/layout.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/zellij-utils/src/input/layout.rs b/zellij-utils/src/input/layout.rs index d2125096e..3289f77d4 100644 --- a/zellij-utils/src/input/layout.rs +++ b/zellij-utils/src/input/layout.rs @@ -37,7 +37,9 @@ use url::Url; #[derive(Debug, PartialEq, Eq, Serialize, Deserialize, Clone, Copy)] #[serde(crate = "self::serde")] pub enum Direction { + #[serde(alias = "horizontal")] Horizontal, + #[serde(alias = "vertical")] Vertical, } @@ -55,7 +57,9 @@ impl Not for Direction { #[derive(Debug, Serialize, Deserialize, Clone, Copy, PartialEq)] #[serde(crate = "self::serde")] pub enum SplitSize { + #[serde(alias = "percent")] Percent(f64), // 1 to 100 + #[serde(alias = "fixed")] Fixed(usize), // An absolute number of columns or rows } |