Johan Walles
6c86039965
Move background highlighting into its own function
2024-01-01 18:11:17 +01:00
Johan Walles
855a6bf5cb
Fix a test
2024-01-01 13:49:43 +01:00
Johan Walles
52e04a6eda
Further slim down the highlighting API
2024-01-01 13:47:38 +01:00
Johan Walles
d8d76374f2
Update one test
2024-01-01 13:47:38 +01:00
Johan Walles
2d2844f68c
Modify the highlighting API
...
This changes the highlighting API to take a string instead of a file
because strings are what Chroma can highlight.
With this change in place, we should invoke the highlighter after
we're done reading the input. This will allow highlighting both files
(as before) and streaming input.
This also moves the responsibility of checking the file against the max
highlight size from the highlighter to the caller.
2024-01-01 13:47:38 +01:00
Johan Walles
64022c8909
Merge pull request #179 from walles/johan/revive
...
Use Revive for finding unused code
2024-01-01 13:47:08 +01:00
Johan Walles
786b0d4e06
Bump CI version of golangci-lint
2024-01-01 13:43:39 +01:00
Johan Walles
4e4d7fd923
Handle warnings in moar.go
2024-01-01 13:42:42 +01:00
Johan Walles
ff74c2d27c
Handle warnings in twin
2024-01-01 13:39:30 +01:00
Johan Walles
8667ded229
Disable warnings for existing issues
...
Fix in the future as needed.
2024-01-01 13:33:30 +01:00
Johan Walles
f0bc8f2258
Enable revive for unused parameters check
2024-01-01 13:30:25 +01:00
Johan Walles
4475ce5c63
Improve a comment
2023-12-28 18:42:50 +01:00
Johan Walles
e80c60439b
Revert "Merge branch 'johan/ui-colors-from-chroma'"
...
This reverts commit ed491742a1
, reversing
changes made to 12f316f8c8
.
Before this goes in, we should first auto detect bright vs dark terminal
background and default to different themes in those two cases: #67
2023-12-28 18:42:04 +01:00
Johan Walles
794047451e
Merge pull request #174 from emanuel-skrenkovic/limit-right-scroll
...
Limit right paging to text
2023-12-28 18:37:04 +01:00
Johan Walles
2f6be78e4d
Use the same code for wrapped and non-wrapped lines
2023-12-28 18:34:59 +01:00
Emanuel Skrenković
1acffbd42e
Page right only to after last char
...
When paging right, it was possible to infinitely go to the right. This
commit changes that so it is only possible to go right until the last
visible character is out of screen.
2023-12-26 12:10:19 +01:00
Johan Walles
ed491742a1
Merge branch 'johan/ui-colors-from-chroma'
2023-12-20 21:03:16 +01:00
Johan Walles
ec18b19af2
Cosmetics
2023-12-20 20:58:42 +01:00
Johan Walles
fe0abda2d2
More Chroma color extraction tests
2023-12-20 20:01:15 +01:00
Johan Walles
a0559394cc
Be more forgiving of Chroma styles
2023-12-20 18:55:05 +01:00
Johan Walles
40826865a2
Merge remote-tracking branch 'origin/master' into johan/ui-colors-from-chroma
2023-12-20 18:38:42 +01:00
Johan Walles
12f316f8c8
Widen the color interface
2023-12-20 18:37:34 +01:00
Johan Walles
d981d6b6a5
Merge remote-tracking branch 'origin/master' into johan/ui-colors-from-chroma
2023-12-20 18:35:49 +01:00
Johan Walles
af014a33b9
Improve naming
2023-12-20 18:34:32 +01:00
Johan Walles
a99c17012b
Merge remote-tracking branch 'origin/master' into johan/ui-colors-from-chroma
2023-12-20 18:32:52 +01:00
Johan Walles
b103f0c10b
Drop redundant dependency
...
Chroma already provides enough color handling for our needs.
2023-12-20 18:28:07 +01:00
Johan Walles
22885dc4b0
Test looping over all styles' background colors
2023-12-20 16:15:29 +01:00
Johan Walles
d13e9d4994
Improve naming
2023-12-20 14:59:55 +01:00
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