1
1
mirror of https://github.com/walles/moar.git synced 2024-09-11 12:15:43 +03:00
Commit Graph

1064 Commits

Author SHA1 Message Date
Johan Walles
4167d6997f Highlight streams if we know the language 2024-01-03 10:41:53 +01:00
Johan Walles
83c1c7be38
Merge pull request #180 from walles/johan/force-format
Add a -lang option for setting the highlighting language
2024-01-02 16:18:22 +01:00
Johan Walles
d5fb484fb9 Add --lang to the man page 2024-01-02 16:14:19 +01:00
Johan Walles
cb07ce3d3a Tune --lang explanation 2024-01-02 15:43:33 +01:00
Johan Walles
cd2a8a9d09 Fix some error messages
After testing. The invalid value is already printed by the framework, no
need to include it in the error message.
2024-01-02 15:36:45 +01:00
Johan Walles
4264d277dc Make the tests pass 2024-01-02 15:32:08 +01:00
Johan Walles
a6d62191f8 Remedy a warning 2024-01-02 09:50:20 +01:00
Johan Walles
cfbbcb7980 Fix production code compile errors 2024-01-02 09:46:19 +01:00
Johan Walles
b7603ea026 Add a -lang option for input file language 2024-01-02 09:39:47 +01:00
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