diff options
| author | benzwt <benzwt@gmail.com> | 2023-12-25 18:14:26 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-12-25 11:14:26 +0100 |
| commit | cefc93457821b1357eb24e7872c054da548fe7dd (patch) | |
| tree | 01dbe18be82c7450fb04ffbd796dc52035b0e4e8 /src/widgets/command.rs | |
| parent | feat: add bench for command widget (diff) | |
| download | sl0pstatus-cefc93457821b1357eb24e7872c054da548fe7dd.tar.gz sl0pstatus-cefc93457821b1357eb24e7872c054da548fe7dd.tar.xz sl0pstatus-cefc93457821b1357eb24e7872c054da548fe7dd.zip | |
feat: don't call format_string if the command_xxx_format doesn't contains (#28)
style syntax.
This will let the external command to take the responsibly for the output of the content.
For example, this feature let conky output its result along with the raw color codes.
Diffstat (limited to 'src/widgets/command.rs')
| -rw-r--r-- | src/widgets/command.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/widgets/command.rs b/src/widgets/command.rs index cd65105..e9aebcd 100644 --- a/src/widgets/command.rs +++ b/src/widgets/command.rs @@ -93,8 +93,12 @@ impl Widget for CommandWidget { .unwrap_or(&command_result.stderr), ); } - - command_config.format.format_string(&content) + if command_config.format != FormattedPart::default() { + command_config.format.format_string(&content) + } + else{ + return content; + } } fn process_click(&self, _state: &ZellijState, _pos: usize) {} |
