1
1
mirror of https://github.com/walles/moar.git synced 2024-08-16 07:20:31 +03:00
Commit Graph

777 Commits

Author SHA1 Message Date
Johan Walles
abc235fbef Test case for #166
This test reproduces the symptoms of the crash in #166.

Next step is to make it not crash any more.
2023-12-01 06:57:08 +01:00
Johan Walles
ddd7aec274 This is benign
So log it as debug rather than warning.

Ref: https://github.com/walles/moar/issues/164#issuecomment-1831255422
2023-11-29 14:03:55 +01:00
Johan Walles
0e27391c53 Bump event queue size
Fixes #164

Or at least that's the intent, I'm unable to test this.
2023-11-13 13:17:20 +01:00
Johan Walles
f2360746f1 Add forgotten newline
Before this change, ReprintAfterExit() didn't end its output with a
newline.

Now it does.

Fixes #165
2023-11-13 13:10:06 +01:00
Johan Walles
dab644878c Improve CSI parsing 2023-11-13 08:51:05 +01:00
Johan Walles
8c4a133008 Add line numbers to escape sequence log messages 2023-11-13 08:50:37 +01:00
Johan Walles
b8e86b0aef Improve escape sequence parsing diagnostics
And move them to --debug.
2023-11-13 07:44:08 +01:00
Johan Walles
a3df10be92 Improve BenchmarkHighlightedSearch performance
By about 18%. By working on uints instead of strings.
2023-11-12 09:31:15 +01:00
Johan Walles
bcda779bb7 Improve CSI sequence error handling 2023-11-12 08:41:06 +01:00
Johan Walles
93d01ee51d Support colon separated SGR codes
Unsure why colon separated colors exist, but the fact is that a number
of things emit colon separated SGR codes. And numerous terminals accept
them (search page for "delimiter"):
https://github.com/kovidgoyal/kitty/issues/7

Johan got an e-mail titled "moar question: "--RAW-CONTROL-CHARS"
equivalent" about the sequence we're testing here.
2023-11-11 19:58:28 +01:00
Johan Walles
538d890442 Ignore prompt hints
Makes no sense to

Ref: https://gitlab.freedesktop.org/Per_Bothner/specifications/blob/master/proposals/semantic-prompts.md
2023-11-11 16:39:09 +01:00
Johan Walles
cfdf99d3e3 Merge branch 'johan/functional-ssfs'
This merge splits the styled string splitter into multiple functions for
readability and maintainability.

This makes the BenchmarkHighlightedSearch about 10% slower, but I think
it's worth the tradeoff.
2023-11-11 15:39:25 +01:00
Johan Walles
3676bbfd41 Make string splitting a lot faster 2023-11-11 09:24:08 +01:00
Johan Walles
51c822570b Drop the double bookkeeping of style
It didn't work.
2023-11-11 09:05:57 +01:00
Johan Walles
ba3e8bd16e Fix URL parsing 2023-11-11 08:48:07 +01:00
Johan Walles
d720d32c0d Improve test result parseability
By putting the current file name in the test case name.
2023-11-11 08:40:05 +01:00
Johan Walles
d5d576b75f Fix lastChar() 2023-11-11 08:33:07 +01:00
Johan Walles
a57a6c4709 Fix one test failure
Cause four new ones.
2023-11-10 23:02:10 +01:00
Johan Walles
76ad92a34d Add subtests for readability 2023-11-10 22:50:23 +01:00
Johan Walles
c7b4dbf2fd Split the string splitter into functions
For great maintainability.

URL tests failing, go fix.
2023-11-10 22:33:57 +01:00
Johan Walles
c4e94374ac Fix the catppuccin style colors
Ref:
https://github.com/walles/moar/issues/159#issuecomment-1763058160
2023-10-14 22:38:42 +02:00
Johan Walles
cbbdaf632b Always use style color for plain text
Before this change, it only worked on 16M color terminals.

After there's a Chroma release with
https://github.com/alecthomas/chroma/pull/869 in it we should revert
back to "None" here and use the new Chroma release instead.
2023-10-14 08:51:08 +02:00
Johan Walles
ae34878ee5 Document assertions
To clarify questions from #163.
2023-10-14 08:43:18 +02:00
Johan Walles
9c2f1ca57f
Merge pull request #163 from Wallunen/fix-rendering-of-whitespace-lines
Fix rendering of whitespace lines
2023-10-14 08:38:27 +02:00
Wallunen
6f2691ca10
Fix tests in twin/screen_test.go 2023-10-14 06:04:13 +03:00
Wallunen
3f1457aacb
Fix rendering of whitespace lines 2023-10-13 19:58:41 +03:00
Johan Walles
aa2b3c91b5 Don't use "string" as a variable name 2023-10-12 07:05:42 +02:00
Johan Walles
273d92c644 "None" is the proper fallback
"None" is documented as "No highlighting".
2023-10-12 07:00:39 +02:00
Johan Walles
e0c8d4b2dc Merge branch 'johan/fix-kitty-eol'
Fixes #161
2023-10-10 21:40:22 +02:00
Johan Walles
123b3c3692 Complete mutation coverage 2023-10-10 21:38:03 +02:00
Johan Walles
40a5ab1430 Cover one more mutation 2023-10-10 21:33:18 +02:00
Johan Walles
5313c02dd6 Simplify line rendering more 2023-10-10 21:26:43 +02:00
Johan Walles
dff0774141 Simplify line rendering 2023-10-10 21:14:36 +02:00
Johan Walles
99de54c510 Pass another mutation test 2023-10-10 20:46:53 +02:00
Johan Walles
8478883821 Test another corner case
It worked!
2023-10-10 06:18:03 +02:00
Johan Walles
a082fe207e Use the correct style for the trailer 2023-10-10 06:16:09 +02:00
Johan Walles
59a636205a Add trailing whitespace test
Failing.
2023-10-10 06:01:49 +02:00
Johan Walles
d7c104e80a Be smarter about line endings
Doesn't help Kitty though, don't know why.
2023-10-09 19:52:01 +02:00
Johan Walles
cd95996e8e Shortcut common style changes 2023-10-09 19:45:43 +02:00
Johan Walles
47e72d093c Fix an outdated test 2023-10-09 19:45:27 +02:00
Johan Walles
c747b8ec0b Add test for #161
It fails.
2023-10-08 12:00:07 +02:00
Johan Walles
b7f0e24fbf Default to --colors=auto 2023-10-06 22:13:26 +02:00
Johan Walles
251513ef66 Use plain style color for unclassified text
I believe this fixes #159.
2023-10-06 19:03:48 +02:00
Johan Walles
41e2efc05b
Merge pull request #160 from ilyagr/homeend
keys.go: Allow alternative Home/End key encoding
2023-09-30 17:06:33 +02:00
Ilya Grigoriev
7b8d7eafe3 keys.go: Allow alternative Home/End key encoding
My setup is Tmux running in Alacritty on Debian Linux running on Chrome OS.
Before this change, Home and End keys did not work for me inside Tmux.
(Outside tmux, I don't think there was a problem).

I got the required sequences by running `cat` and pressing Home/End.

This looks similar to (or possibly the opposite of)
daafbcdac4.
The reference in that commit mentions these sequences for Home and End, these
kinds of sequences were already used for Delete, PgUp, and PgDown. 

For reference, the missing `\x1b[2~`  sequence would correspond to the Insert
key.
2023-09-29 23:30:38 -07:00
Johan Walles
faafc49471 Accept +1234 argument in any place
Fixes the issue reported with PR #158:
https://github.com/walles/moar/pull/158#issue-1918313499
2023-09-29 22:42:41 +02:00
Johan Walles
242c050adf
Merge pull request #158 from m3tav3rse/arg0
Fix +number flag handling
2023-09-29 07:08:55 +02:00
m3tav3rse
3e75780a92
Fix + flag handling
Currently only works for: moar file +123
2023-09-28 23:20:54 +02:00
Johan Walles
822bd80f05
Merge pull request #157 from walles/johan/start-at-line
Add support for +1234 command line option
2023-09-27 20:36:22 +02:00
Johan Walles
1209010995 Handle the options test 2023-09-27 20:33:26 +02:00