Johan Walles
4f7c404845
Formulate the help text
2019-07-26 19:15:24 +02:00
Johan Walles
bcc83f9d0a
Actually show some text on pressing "h"
2019-07-26 19:07:51 +02:00
Johan Walles
009d890dbc
Initial built-in help commit
...
Help text needs to be written, and a NewReaderFromText() function needs
implementing.
2019-07-26 09:26:58 +02:00
Johan Walles
8fbf3dfaa7
Report file IO problems even for filtered files
...
Before this change, trying to open a filterable file that didn't exist,
like "REAXDME.md" for example, would result in us displaying an empty
pager.
With this change in place, that now results in an error message.
2019-07-25 07:46:58 +02:00
Johan Walles
8ad5329a8d
Fix PAGER= setting detection
2019-07-15 22:47:36 +02:00
Johan Walles
a77d4f058c
Only inform about PAGER= if we're not already it
2019-07-15 22:43:27 +02:00
Johan Walles
5139da5d08
Only inform about highlight if it's not installed
2019-07-15 22:35:19 +02:00
Johan Walles
a2eca47d54
Let --help explain our dependence on highlight
2019-07-15 22:32:27 +02:00
Johan Walles
a856e4d9c8
Explain how to make moar the default pager
2019-07-15 22:27:41 +02:00
Johan Walles
d2e94fd26c
Take control of --help output
2019-07-15 22:14:36 +02:00
Johan Walles
ebba21a409
Dodge corner case issue
...
If call "highlight" on an empty file the output will have a line.
We don't really care about that.
This change renames empty.txt (which highlight wants to highlight) into
just "empty", which highlight will not try to highligt, so no line is
added and the test passes.
2019-07-15 18:49:25 +02:00
Johan Walles
0f0c8a1111
Don't highlight files with unsupported file extensions
2019-07-15 18:46:53 +02:00
Johan Walles
a66f8b41ba
Don't highlight extensionless files
2019-07-15 18:32:43 +02:00
Johan Walles
1103ebf5bc
Add tokenizer tests
2019-07-15 13:34:42 +02:00
Johan Walles
e473c1bc60
Merge branch 'walles/go-bg-reader' into go
2019-07-15 07:11:22 +02:00
Johan Walles
35429e672b
Make first line read appear immediately
2019-07-15 07:08:04 +02:00
Johan Walles
2bc8215d59
Stop logging more-lines events as unhandled
2019-07-14 23:18:26 +02:00
Johan Walles
480bbc031e
Only update display every 200ms
...
Even if we get multiple lines during that time. This improves CPU usage,
and most likely responsiveness.
2019-07-14 23:10:54 +02:00
Johan Walles
937951d610
Fix pager hangs
2019-07-14 18:59:21 +02:00
Johan Walles
bfbdadd6c7
Minor clarifications
2019-07-13 22:55:21 +02:00
Johan Walles
195f48f229
Move stream reading into its own function
2019-07-12 06:35:08 +02:00
Johan Walles
447da01d49
Handle new lines arriving
...
We display the lines, but we also just freeze. Try "./moar.sh moar.sh"
and try to search and you'll see.
2019-07-11 18:52:20 +02:00
Johan Walles
106626388d
Notify a channel after we read a line
2019-07-11 18:34:10 +02:00
Johan Walles
c4c2027dfc
Comment out some failing tests
...
They do find errors, but this branch is not the place to fix those.
2019-07-10 06:44:10 +02:00
Johan Walles
c1665113e6
Add more tests, find more problems...
2019-07-10 00:21:36 +02:00
Johan Walles
a43aafe7b9
Fix concurrency issues in the tests...
...
... and unveil actual highlighting problems.
2019-07-09 23:41:49 +02:00
Johan Walles
ddee885e92
Make tests compile
...
But not pass. The tests need to wait for the reader to get done before
verifying what it did.
2019-07-09 19:57:32 +02:00
Johan Walles
0a6dbbe909
Input now read in the background, but...
...
... the reader still needs to notify the pager when new lines are
available, and the pager must update the display if it would affect the
display, but not too often.
2019-07-09 19:53:04 +02:00
Johan Walles
56feddd038
Code reshufflings
...
Pager still doesn't show anything.
2019-07-09 06:12:18 +02:00
Johan Walles
399d5d6975
WIP: First stab at background reading
...
Try ./moar.sh moar.sh, nothing is shown. Fix stuff.
2019-07-08 18:58:37 +02:00
Johan Walles
f97e50fe2c
Add two comments
2019-07-08 08:58:53 +02:00
Johan Walles
31ae7927c7
Print bug reporting instructions on panics
2019-07-08 06:42:48 +02:00
Johan Walles
17787b1212
Add install-from-source instructions
2019-07-07 18:44:08 +02:00
Johan Walles
6cb22bdd5d
Merge branch 'walles/go-version' into go
...
Implement --version command line flag
2019-07-07 18:36:25 +02:00
Johan Walles
0fbb2ce8d3
Write version number into executable
2019-07-07 18:35:55 +02:00
Johan Walles
84ae2cb21c
Add --version tests
...
They fail.
2019-07-07 18:23:57 +02:00
Johan Walles
92b0133b25
Add initial option parsing support
2019-07-07 18:18:29 +02:00
Johan Walles
2f5c2da2e3
Case insensitive search on lowercase-only pattern
2019-07-06 22:16:08 +02:00
Johan Walles
ea5b4fdefe
Extract search string compilation into its own testable function
2019-07-06 13:51:48 +02:00
Johan Walles
1e7cc90455
Merge branch 'walles/go-search' into go
2019-07-06 13:34:13 +02:00
Johan Walles
633d4b0db7
Scroll left and right using arrow keys
2019-07-06 13:33:41 +02:00
Johan Walles
16c92de86c
Add support for searching backwards
2019-07-06 10:31:40 +02:00
Johan Walles
0f7ae9d089
Warn about unexpected pager modes
2019-07-06 07:54:33 +02:00
Johan Walles
ed657dbde6
Implement searching for next hit
2019-07-06 07:45:07 +02:00
Johan Walles
7d6f1f5361
Scroll to first hit while typing
2019-06-30 22:16:04 +02:00
Johan Walles
9693c91aac
Reset search on new '/'
2019-06-30 22:15:27 +02:00
Johan Walles
0646c58a5f
Restore screen before printing log messages
2019-06-30 22:11:26 +02:00
Johan Walles
f16d818715
Have the tokenizer provide an unformatted string as well
2019-06-30 15:06:33 +02:00
Johan Walles
a90f4939a4
Merge branch 'walles/go-search' into go
...
This enables search in a way, but it only highlights matches, it doesn't
scroll to where they are.
2019-06-30 09:54:23 +02:00
Johan Walles
4541f7fb08
Fix crash before first search
2019-06-30 09:53:24 +02:00