mirror of
https://github.com/arl/gitmux.git
synced 2026-09-10 07:26:18 -04:00
Set 'Clear' to #[none] (#108)
* Cosmetics * Default 'Clear' style is now #[none] None actually resets all attributes. * Always append the Clear attribute to gitmux status string Fix #107
This commit is contained in:
parent
076c75ffd4
commit
b821624bad
|
|
@ -32,7 +32,7 @@ tmux:
|
|||
# https://man7.org/linux/man-pages/man1/tmux.1.html#STYLES.
|
||||
styles:
|
||||
# Clear previous style.
|
||||
clear: "#[fg=default]"
|
||||
clear: "#[none]"
|
||||
# Special tree state strings such as [rebase], [merge], etc.
|
||||
state: "#[fg=red,bold]"
|
||||
# Local branch name
|
||||
|
|
|
|||
|
|
@ -4,8 +4,9 @@ import (
|
|||
_ "embed"
|
||||
"fmt"
|
||||
|
||||
"github.com/arl/gitmux/tmux"
|
||||
"gopkg.in/yaml.v3"
|
||||
|
||||
"github.com/arl/gitmux/tmux"
|
||||
)
|
||||
|
||||
// Config configures output formatting.
|
||||
|
|
|
|||
2
testdata/default.output.txt
vendored
2
testdata/default.output.txt
vendored
|
|
@ -51,4 +51,4 @@ with some different content
|
|||
|
||||
-- empty_file --
|
||||
-- output.golden --
|
||||
#[fg=default]#[fg=default]#[fg=white,bold]⎇ #[fg=default]#[fg=white,bold]main#[fg=default] - #[fg=default]#[fg=green,bold]● 1 #[fg=red,bold]✚ 1 #[fg=cyan,bold]⚑ 1 #[fg=magenta,bold]… 2#[fg=default,bg=default]
|
||||
#[none]#[none]#[fg=white,bold]⎇ #[none]#[fg=white,bold]main#[none] - #[none]#[fg=green,bold]● 1 #[fg=red,bold]✚ 1 #[fg=cyan,bold]⚑ 1 #[fg=magenta,bold]… 2#[fg=default,bg=default]#[none]
|
||||
|
|
|
|||
|
|
@ -135,6 +135,8 @@ func truncate(s, ellipsis string, max int, dir direction) string {
|
|||
|
||||
// Format writes st as json into w.
|
||||
func (f *Formater) Format(w io.Writer, st *gitstatus.Status) error {
|
||||
defer fmt.Fprintf(w, "%s", f.Styles.Clear)
|
||||
|
||||
f.st = st
|
||||
|
||||
// Overall working tree state
|
||||
|
|
|
|||
Loading…
Reference in a new issue