diff options
author | a-kenji <aks.kenji@protonmail.com> | 2021-11-14 22:58:20 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-14 22:58:20 +0100 |
commit | 347e02ea35793ba7e898ca0693f569a21525d459 (patch) | |
tree | beab3ed6f4102b96cffa8c7c7cfbaaa33d794943 /zellij-utils/src/input/theme.rs | |
parent | 96315ed332438374743d73d3e3b38c3cdbdc3331 (diff) |
feature(layout): add layout config (#866)
feature(layout): add layout config (#866)
* It is now possible to configure zellij through a layout:
The config file and the layout file will be merged, on conflicting
options the order is as follows:
1. config options `zellij options`
2. layout
3. config
Example:
```
---
template:
direction: Horizontal
parts:
- direction: Vertical
body: true
- direction: Vertical
borderless: true
split_size:
Fixed: 1
run:
plugin:
location: "zellij:tab-bar"
default_shell: fish
```
Diffstat (limited to 'zellij-utils/src/input/theme.rs')
-rw-r--r-- | zellij-utils/src/input/theme.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/zellij-utils/src/input/theme.rs b/zellij-utils/src/input/theme.rs index 35bd3d87b..da71b6334 100644 --- a/zellij-utils/src/input/theme.rs +++ b/zellij-utils/src/input/theme.rs @@ -63,6 +63,14 @@ impl ThemesFromYaml { .get_theme(theme) .map(|t| Palette::from(t.palette)) } + + /// Merges two Theme structs into one Theme struct + /// `other` overrides the Theme of `self`. + pub fn merge(&self, other: Self) -> Self { + let mut theme = self.0.clone(); + theme.extend(other.0); + Self(theme) + } } impl From<PaletteFromYaml> for Palette { |