Commit graph

66 commits

Author SHA1 Message Date
Mislav Marohnić
ac7d5ecc44 Ensure markdown still passed through Glamour in no-color mode 2020-06-22 19:44:16 +02:00
Mislav Marohnić
04b18ea8cb 🔥 unused var 2020-06-22 19:32:06 +02:00
Mislav Marohnić
55be0d2a9c Tweak isColorEnabled 2020-06-22 19:18:18 +02:00
gabgodBB
e6e8f701a2 Issue #930 - Removing color for output files 2020-06-12 14:26:38 -03:00
gedenata
4c94d126da variable global color 2020-06-10 14:02:42 +08:00
gedenata
81799caeb6 variable global color 2020-06-10 13:59:28 +08:00
gedenata
417de6257a variable global color 2020-06-10 13:57:31 +08:00
vilmibm
15a6225f05 totally inelegant approach to hopefully stopping flakey tests 2020-04-29 14:17:16 -05:00
Mislav Marohnić
aa183d7408 Set spinner writer stream in a preferred way 2020-04-13 14:09:56 +02:00
Mislav Marohnić
250114e2c0
Merge pull request #742 from brettbuddin/no-color
Support NO_COLOR environment variable to disable color
2020-04-03 19:10:16 +02:00
Mislav Marohnić
734497a8d8
Code fixes informed by golangci-lint failures (#738) 2020-04-03 16:33:34 +02:00
Brett Buddin
0cc41b4912
Provide notty style to glamour when colors are disabled. 2020-04-02 21:09:29 -04:00
Brett Buddin
48e7df2337
Any non-empty value should be a disabling intent.
Conforms to the informal standard proposed in https://no-color.org
2020-04-02 20:31:04 -04:00
Brett Buddin
21e445beab
Support NO_COLOR environment variable to disable color. 2020-04-02 20:22:55 -04:00
vilmibm
f4b8851011 Merge remote-tracking branch 'origin/master' into pr-status-no-commits 2020-03-25 12:00:58 -05:00
vilmibm
5187ad4431 move preparecmd and Runnable to its own package 2020-03-23 16:32:29 -05:00
Mislav Marohnić
488b47bded Enable tests to capture spinner output
Explicitly assign the writer stream for the progress spinner so that
tests may override it.

The default when not in testing stays the same: the output stream is the
colorable stdout.
2020-03-20 18:18:27 +01:00
vilmibm
0344e9543a humanize branch name for title 2020-03-17 16:18:32 -05:00
Christian Muehlhaeuser
0d6e347155
Bump glamour dependency
This indirectly also updates the chroma syntax highlighting package,
which fixes a rendering bug for CRLF line endings, which we
encountered in cli. We can therefore remove our internal work-around.
2020-03-04 15:03:04 +01:00
Nate Smith
3d7733870e
Merge branch 'master' into repo-fork 2020-03-03 15:40:54 -06:00
vilmibm
1217bfce09 add spinner helper 2020-02-26 11:41:54 -06:00
Dasio
9289ab99f2 Use var syntax when empty struct is initialized 2020-02-24 22:33:22 +01:00
Mislav Marohnić
9c2efd6c1c Extract reusable IsTerminal() 2020-02-21 12:46:21 +01:00
Mislav Marohnić
4c3e498021 Fix column alignment and truncation for Eastern Asian languages
- Ensure that text is never truncated mid-character, which would result
  in garbled text

- Ensure that columns in `issue/pr list` output align properly
2020-02-20 18:52:17 +01:00
Nate Smith
c65ac4ae9d
Merge branch 'master' into glamour-markdown 2020-02-18 14:23:49 -06:00
Mislav Marohnić
61ff5d73bd Fix crash in issue/pr list for narrow terminals
If the available column width is smaller than 3, don't try to truncate
with ellipsis (`...`). Instead, just truncate to available width.
2020-02-18 20:03:09 +01:00
Nicolas Martin
950144945f Use glamour as markdown rendering backend for issue & pr previews
glamour uses the CommonMark compliant Goldmark markdown parser instead of
go-termd which is based on Blackfriday.
2020-02-06 00:20:16 +01:00
Mislav Marohnić
fe7cdd8ab7 Extract web browser launching to a package
This fixes opening URLs with `&` on Windows.
2020-01-29 11:49:38 +01:00
vilmibm
d7d575fccb support more time units 2020-01-21 14:25:38 -06:00
vilmibm
a4b97014d1 stray TODO 2020-01-17 16:07:35 -06:00
vilmibm
a297153637 test for utils.FuzzyAgo 2020-01-17 15:57:02 -06:00
vilmibm
bfdf89b579 updated based sorting and fuzzy time display on issue status 2020-01-17 15:38:41 -06:00
vilmibm
daf02ff3ec de-inline go-termd 2020-01-13 16:10:22 -06:00
vilmibm
4592aaf63d clarify newline normalization 2020-01-13 15:36:43 -06:00
vilmibm
5bc6d220c4 review feedback 2020-01-13 15:32:07 -06:00
vilmibm
bc1ab20cdf turns out this has frightening state 2020-01-10 15:40:09 -06:00
vilmibm
e42b097629 inline a markdown rendering lib
This commit inlines https://github.com/tj/go-termd for a few reasons:

- off the shelf it relies on a broken, erroneously released version of
blackfriday (a markdown parser)
- based on discussion with ampinsk, there are some tweaks we'd like to
make to markdown rendering beyond what the library exposes now
- it's a small library (around 300 sloc)

This commit only:

- messes with go.mod to fix the blackfriday issues
- adds an inclusion note
- renames the package
2020-01-10 14:44:51 -06:00
vilmibm
4925c3cf01 preview PRs and issues in the terminal with -p 2020-01-10 11:41:26 -06:00
Mislav Marohnić
a0458956c0 Add docs to color funcs 2019-11-28 11:55:14 +01:00
Mislav Marohnić
e636e3e613 Merge remote-tracking branch 'origin/master' into cygwin-color 2019-11-28 11:52:45 +01:00
Mislav Marohnić
ebb7f39985 Merge remote-tracking branch 'origin/master' into ansi-colorfunc 2019-11-28 11:48:54 +01:00
Mislav Marohnić
b6fa88337d Ensure that commands print to a colorable output
If a command does `fmt.Print(...)` for output that contains ANSI color
codes, this not safe on Windows. We have to ensure that we always use
the `fmt.Fprint*` family of functions with a writer that was transformed
using `utils.NewColorable()`.
2019-11-27 20:51:51 +01:00
Mislav Marohnić
4148cf76b9 Merge remote-tracking branch 'origin' into win-ansi-color 2019-11-27 20:08:00 +01:00
Mislav Marohnić
24b04b5fca Make use of ansi.ColorFunc
Speed up repeated calls to color functions by using ansi.ColorFunc to
create a closure per each color.

https://godoc.org/github.com/mgutz/ansi#ColorFunc
2019-11-27 19:16:53 +01:00
Mislav Marohnić
004ab1e9db Fix color output to Git Bash 2019-11-27 18:58:23 +01:00
Mislav Marohnić
4be04aded3 Fix ANSI color output on Windows 2019-11-27 15:43:28 +01:00
Mislav Marohnić
7d904fdef7 Fix detecting terminal under Git Bash on Windows 2019-11-27 15:31:37 +01:00
Mislav Marohnić
7f4833d84e 🔥 unused code 2019-11-26 14:14:31 +01:00
Mislav Marohnić
97a6dc494b Redesign TablePrinter to avoid SetContentWidth / FitColumns steps
The API is now:
- AddField;
- EndRow;
- Render.
2019-11-20 13:29:27 +01:00
Mislav Marohnić
2022f8e74b Avoid widening table columns that already fit 2019-11-20 12:30:24 +01:00