diff options
| author | Daniel Jankowski <daniel.jankowski@rub.de> | 2023-11-13 23:14:36 +0100 |
|---|---|---|
| committer | Daniel Jankowski <daniel.jankowski@rub.de> | 2023-11-13 23:31:39 +0100 |
| commit | 1d6e7142121e771a931430d64e37ae9d6df3b074 (patch) | |
| tree | 1c9408e79f74ec0918991d953529fd2779bc4b2e /src/render.rs | |
| parent | fix: dont check if detached due to wrong info from zellij (diff) | |
| download | sl0pstatus-1d6e7142121e771a931430d64e37ae9d6df3b074.tar.gz sl0pstatus-1d6e7142121e771a931430d64e37ae9d6df3b074.tar.xz sl0pstatus-1d6e7142121e771a931430d64e37ae9d6df3b074.zip | |
feat: allow multiple formats in mode widget
Diffstat (limited to 'src/render.rs')
| -rw-r--r-- | src/render.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/render.rs b/src/render.rs index 0fd554e..cb77e0d 100644 --- a/src/render.rs +++ b/src/render.rs @@ -16,6 +16,19 @@ pub struct FormattedPart { } impl FormattedPart { + pub fn multiple_from_format_string(config: String) -> Vec<Self> { + let mut output = Vec::new(); + + let color_parts = config.split("#["); + for color_part in color_parts { + let part = FormattedPart::from_format_string(color_part.to_string()); + + output.push(part); + } + + output + } + pub fn from_format_string(format: String) -> Self { let mut format = format; if format.starts_with("#[") { |
