dj95 / zjstatus

A configurable statusbar plugin for zellij
MIT License
358 stars 6 forks source link

Support for multiple formatting directives in command #69

Closed zDonik1 closed 1 week ago

zDonik1 commented 2 weeks ago

Describe the bug Multiple format directives cannot be used when giving a format for the command widget.

To Reproduce Steps to reproduce the behavior:

  1. Take the default zjstatus config.
  2. Edit the command_git_branch_format to be "#[fg=green]branch#[fg=blue] {stdout} "
  3. Check the format of branch (in a git repo)

Expected behavior Only the first formatting directive is parsed, while the rest are ignored.

Screenshots image

Desktop (please complete the following information):

Layout

How does the layout look like? Please copy it into a code block.

layout {
    default_tab_template {
        children
        pane size=1 borderless=true {
            plugin location="file:/nix/store/8sc7dmdfsri8cybl6gh85cfs5b1lqc5x-zjstatus-0.15.0/bin/zjstatus.wasm" {
                format_left   "{mode} #[fg=#f2cdcd]  #[fg=#a6adc8]{session}"
                format_center "{tabs}"
                format_right "{command_git_branch}"
                format_space  ""

                border_enabled  "false"
                border_char     "─"
                border_format   "#[fg=#6C7086]{char}"
                border_position "top"

                mode_normal       "#[bg=#89b4fa,fg=#11111b,bold] NORMAL#[fg=#89b4fa]"
                mode_tmux         "#[bg=#a6e3a1,fg=#11111b,bold] PREFIX#[fg=#a6e3a1]"
                mode_tab          "#[bg=#fab387,fg=#11111b,bold] TAB#[fg=#fab387]"
                mode_pane         "#[bg=#fab387,fg=#11111b,bold] PANE#[fg=#fab387]"
                mode_rename_tab   "#[bg=#f9e2af,fg=#11111b,bold] RENAME#[fg=#f9e2af]"
                mode_rename_pane  "#[bg=#f9e2af,fg=#11111b,bold] RENAME#[fg=#f9e2af]"
                mode_scroll       "#[bg=#eba0ac,fg=#11111b,bold] SCROLL#[fg=#eba0ac]"
                mode_enter_search "#[bg=#eba0ac,fg=#11111b,bold] SEARCH#[fg=#eba0ac]"

                tab_active   "#[fg=#313244]#[fg=#cdd6f4,bg=#313244,bold] {name} #[fg=#313244,bg=#fab387]#[fg=#11111b,bg=#fab387,bold] {index} #[fg=#fab387]"
                tab_normal   "#[fg=#313244]#[fg=#cdd6f4,bg=#313244] {name} #[fg=#313244,bg=#b4befe]#[fg=#11111b,bg=#b4befe] {index} #[fg=#b4befe]"

                command_git_branch_command     "git rev-parse --abbrev-ref HEAD"
                command_git_branch_format      "#[fg=green]branch#[fg=blue] {stdout} "
                command_git_branch_interval    "10"
            }
        }
    }
}

Additional context Add any other context about the problem here.

dj95 commented 1 week ago

Hi, this is implemented now and will be released with the next version.


Edit: You could also get around this quickly with just placing the #[fg=green]branch before your widget in format_right

zDonik1 commented 1 week ago

Hi, this is implemented now and will be released with the next version.


Edit: You could also get around this quickly with just placing the #[fg=green]branch before your widget in format_right

Hey thanks for implementing it so quickly. I already do that workaround, but this feature was mainly so that the whole widget is hidden while the command is being run