Johan Walles
bb4b582de8
Fix Chroma color conversion
...
Check that the color is set before converting.
2023-12-20 08:48:30 +01:00
Johan Walles
8ec3df792a
Use "select" as a term for selecting text
...
This is a better term, as pointed out by @postsolar in #173
2023-12-19 09:20:02 +01:00
Johan Walles
d045cb6d37
Get line numbers style from Chroma style
2023-12-19 09:06:11 +01:00
Johan Walles
fa44e72563
Merge remote-tracking branch 'origin/master' into johan/ui-colors-from-chroma
...
Color downsampling is now in master, let's merge those changes in here
so we can focus on the UI coloring changes instead.
2023-12-19 08:52:40 +01:00
Johan Walles
d511e50652
Downsample colors to terminal palette
...
As neeed.
This enables you to view 24 bit color documents in a 256 color terminal.
With reduced quality obviously, but still.
2023-12-19 08:47:40 +01:00
Johan Walles
060f89d713
Merge pull request #173 from postsolar/mouse-tips
...
Amend MOUSE.md
2023-12-19 08:20:46 +01:00
postsolar
6b50ed775b
Update MOUSE.md
...
Minor formatting improvements
2023-12-19 08:15:32 +02:00
postsolar
3b8fca86ff
Amend MOUSE.md
...
Add more detailed explanations and a table for the workarounds for different terminals.
Also some stylistic changes for greater consistency and ease of reading.
2023-12-19 07:52:46 +02:00
Johan Walles
f43816c5f7
Don't crash on default colors
2023-12-18 21:21:48 +01:00
Johan Walles
fd6ad48b5d
Fix downsampling code
2023-12-18 21:09:45 +01:00
Johan Walles
28966383f6
Merge remote-tracking branch 'origin/master' into johan/ui-colors-from-chroma
2023-12-18 19:59:46 +01:00
Johan Walles
a3f1c6118d
Document Contour mouse marking
2023-12-18 19:52:10 +01:00
Johan Walles
ccc535074d
Improve foot terminal detection
2023-12-18 09:53:31 +01:00
Johan Walles
2d383f90d5
Fix a crash
...
Fixes #171 specifically.
2023-12-18 09:24:40 +01:00
Johan Walles
5b2653f95e
Status bar still unreadable
...
But the tests pass!
2023-12-18 06:59:38 +01:00
Johan Walles
4eafa5586e
Pass some more tests
...
One to go.
2023-12-17 21:29:34 +01:00
Johan Walles
e916478dbb
WIP: Work on color conversions
...
The first 16 colors work, as does the greyscale range.
The 6x6x6 cube is still broken, but has tests covering it.
2023-12-17 20:59:43 +01:00
Johan Walles
263e7642b3
WIP: Downsample colors to terminal palette
...
But this makes the status bar invisible for me, needs fixing.
2023-12-17 17:28:50 +01:00
Johan Walles
eaab95e3ef
Inform ansiString() about terminal color count
...
So that it can downsample colors when needed.
2023-12-17 16:34:34 +01:00
Johan Walles
0dc490262b
Get status bar style from the Chroma style
2023-12-17 16:12:34 +01:00
Johan Walles
8afb8d583f
Get status bar style from Chroma
2023-12-17 16:12:34 +01:00
Johan Walles
4f45e5dfe9
Move more styling code into styling.go
2023-12-17 16:12:34 +01:00
Johan Walles
e6ac8abe26
Configure status bar once
...
Rather than every time we render it.
2023-12-17 16:12:28 +01:00
Johan Walles
c88c460776
Get line number style from Chroma theme
2023-12-17 16:11:27 +01:00
Johan Walles
21afb4f2ef
Don't track the formatter
...
They are only needed at startup, so let's not keep them around while
paging.
2023-12-17 16:09:29 +01:00
Johan Walles
52516b2121
Merge branch 'johan/styled-man-pages'
...
Fixes #170 by controlling man page formatting using the --style option.
2023-12-17 08:32:41 +01:00
Johan Walles
b2bd0bbe61
Get man page styles from Chroma
...
Untested.
2023-12-17 08:29:46 +01:00
Johan Walles
a7d8e05daa
Some more not-yet-compiling code
2023-12-17 08:29:46 +01:00
Johan Walles
5c5656cbf7
Start changing some code
...
Doesn't compile now, go fix.
2023-12-17 08:29:46 +01:00
Johan Walles
1d4be4bd8d
Simplify some code
2023-12-17 08:29:46 +01:00
Johan Walles
5c73f124f9
Bump Chroma and remove a workaround
2023-12-17 08:29:06 +01:00
Johan Walles
f8c071a233
Print less compat env vars in usage message
...
If present. Would have been useful for troubleshooting in #170 .
2023-12-17 07:47:14 +01:00
Johan Walles
b067a84b36
Auto configure mouse settings in more terminals
...
Tested all the Linux ones in Virtualbox. Yay Virtualbox!
2023-12-16 18:59:58 +01:00
Johan Walles
1d1454af43
Merge branch 'johan/mouse-mode'
...
Relates to #53 , will make things better on some terminals.
2023-12-15 21:44:51 +01:00
Johan Walles
328b16ff80
Update the man page with the new options
2023-12-15 21:44:13 +01:00
Johan Walles
4468a6528c
Add command line options for setting the mouse mode
2023-12-15 21:36:29 +01:00
Johan Walles
a6f188e0ea
Set mouse mode by terminal
...
Some terminals convert mouse events to key events making scrolling
better without our built-in mouse support, and some do not.
With this change in place, on those we know that do this, we let them
handle mouse events instead of enabling our built-in mouse scroll
support.
2023-12-14 03:06:13 +01:00
johan.walles@gmail.com
eb48418c10
Add another hyperlink test
...
Seemed there were no tests for hyperlink rendering.
Now we at least have two.
2023-12-13 09:27:05 +01:00
johan.walles@gmail.com
14c2351e53
Reset hyperlinks properly to unstyled
...
Before this change, if you had a hyperlink followed by unstyled text,
moar wouldn't reset the hyperlink property, messing up everything after
it.
With this change in place, that now works as one would expect.
Fixes #169 .
2023-12-13 09:26:50 +01:00
Johan Walles
1c1e627a71
Make searching 10% faster
...
By avoiding an append() call in a hot path.
2023-12-04 07:49:47 +01:00
Johan Walles
12275c2f81
Make searches 5% faster
...
And simplify the code a bit by putting the split buffer in the
styledStringSplitter object.
2023-12-03 17:34:52 +01:00
Johan Walles
09ff042ff5
Make searches 10% faster
...
Demo:
go test -benchmem -run='^$' -bench=BenchmarkHighlightedSearch . ./...
We got here by avoiding allocations while splitting ANSI escape
sequences into numbers.
2023-12-03 17:23:49 +01:00
Johan Walles
d8055e7ef0
Centralize visible height calculation
...
And stop doing it wrong in some places.
2023-12-02 13:46:15 +01:00
Johan Walles
f71d7e5805
Merge branch 'johan/issue-166'
...
Fixes #166 .
2023-12-02 13:34:07 +01:00
Johan Walles
ee586be6fb
Stop crashing without status bar
2023-12-02 11:25:24 +01:00
Johan Walles
921313d15f
Stop crashing with status bar visible
...
We're still crashing with status bar invisible.
2023-12-02 11:21:38 +01:00
Johan Walles
f9fd1dcb94
Test more scenarios
2023-12-02 11:19:22 +01:00
Johan Walles
a87125ca0c
Repro situation from the real world crash
...
And it panics again!
2023-12-01 09:06:26 +01:00
Johan Walles
37a8c030e6
Make the test more realistic
...
Unfortunately this makes it not repro any more.
2023-12-01 08:33:47 +01:00
Johan Walles
d0465e751e
Remove unneeded code from the test
2023-12-01 07:00:39 +01:00