Commit graph

11 commits

Author SHA1 Message Date
Aurélien Rainone b821624bad
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
2024-01-02 20:00:48 +01:00
Aurélien Rainone 62b966b221
Reset fb and bg to default at the end of the output (#96)
Fix #95
2023-04-05 19:17:12 +02:00
Josh Medeski 395d66dcc3
feat: separate layout items with spaces (#91)
* feat: separate layout items with spaces

* docs: update layout example

* fix: add space after stash

* feat: add trailing space to stats component

* feat: add trailing space to clean section

* test: trailing spaces on all components

* Remove bytes.Buffer, status functions return strings

* Take care of elements spacing in format()

* Fix spacing in default config

---------

Co-authored-by: Aurélien Rainone <aurelien.rainone@gmail.com>
2023-03-22 14:08:19 +01:00
Aurélien Rainone 2f7b93a487
Issue 60/ellipsis (#85)
* Add Ellipsis option, defaults to …

* Modify Test_truncate

* Change default layout (remove .. between branch and remote)

* README.md format

* README.md: document ellipsis

Fixes #60

* Update golden file and fix tests

Since the default config has changed the golden file must be
updated.
2023-02-16 10:09:23 +01:00
Aurélien Rainone 1606e240f4
Issue 77/count insertions deletions (#83)
* tmux: cosmetics

* bump gitstatus to v0.6.0

* testscript: set TestWork to true

* Add Insertions/Deletions to Symbols and Styles

* Show insertions/deletions if 'stats' is in the layout

* Add Test_stats

* Update README.md
2023-02-15 23:27:15 +01:00
Aurélien Rainone 6031fc2b0d
Improve testing (#64)
* Update gitstatus to v0.5.1

Fixes #63

* Use testscript for end-to-end test of gitmux output
2022-03-11 12:39:22 +01:00
Aurélien Rainone c43cc4ce04
Issue 53/divergence style (#54)
Print Divergence style before behind/ahead count

Fixes #53
2021-09-25 07:15:11 -07:00
Aurélien Rainone 9102751c0b
CI: replace travis with GitHub actions (#56)
Fixes #55

* .travis: run tests with go1.17.x

* go.{mod,sum}: bump dependencies

* .gitignore: add dist/

* ci: run test on github-action

* ci: goreleaser runs on github action
2021-09-25 16:07:49 +02:00
Aurélien Rainone 15e791b5fb
Fix use of clear (#39)
* format/tmux: fix usage of tmux #fg=default string

Tmux format string `#fg=default` clears the foreground and is used
before applying styles to the elements of the gitmux format string.

Now, we only call `clear()` before an element that is actually being
printed.
Also we call `clear()` before printing non-keywords strings appearing in
`Config.Layout`.

Fix tests

* Update non-regression golden file
2020-09-02 02:47:02 +02:00
Aurélien Rainone 06654727b5
Issue 32/branch format (#38)
* format/tmux: add failing test for issue 32

As exposed in the added failing test, reproducing the issue 32, the
branch style only affect the branch symbol whereas it should affect both
affect the symbol and the branch name.

* format/tmux: branch style now affects both branch symbol+name

Fixes #32

* Fix tests and adapt for new behavior
2020-09-02 02:37:38 +02:00
Aurélien Rainone c0b7b03325
Breakdown remote component (#27)
* Cosmetics

* Add TestOutputNonRegression

This test ensures that new features do not change gitmux output
when used with a default configuration.
It loads a golden file ('testdata/default.output.golden') and
compares it with the actual output. -update updates the golden
file.

* format/tmux: breakdown `remote` into `remote-flags`+`divergence`

Currently the `remote` flags gets replaced by both the name of the
remote (e.g `origin`) and the divergence flags indicating whether the
local and the remote branch diverges and how much (e.g `↓·2↑·3`).

In order to allow user to skip the remote branch and to keep the
divergence flags, or the other way around, we add the `remote-branch` and
the `divergence` layout elements.

Also, to not break user configurations, we keep the 'remote' layout
element, and make it so that it's equivalent to setting `remote-flags`
and `divergence` consecutively.

Fixes #23

* format/tmux: replace `remote` with `branch+divergence` in default config

* Update README.md: improve the customizing section

Improve the Customizing section of the README
2020-06-07 20:07:02 +02:00