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/plugins.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/plugins.rs')
-rw-r--r-- | zellij-utils/src/input/plugins.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/zellij-utils/src/input/plugins.rs b/zellij-utils/src/input/plugins.rs index e97a8ad03..6be975e4d 100644 --- a/zellij-utils/src/input/plugins.rs +++ b/zellij-utils/src/input/plugins.rs @@ -62,6 +62,14 @@ impl PluginsConfig { pub fn iter(&self) -> impl Iterator<Item = &PluginConfig> { self.0.values() } + + /// Merges two PluginConfig structs into one PluginConfig struct + /// `other` overrides the PluginConfig of `self`. + pub fn merge(&self, other: Self) -> Self { + let mut plugin_config = self.0.clone(); + plugin_config.extend(other.0); + Self(plugin_config) + } } impl Default for PluginsConfig { |