1
1
mirror of https://github.com/walles/moar.git synced 2024-11-22 21:50:43 +03:00
Commit Graph

1123 Commits

Author SHA1 Message Date
Johan Walles
42b0bc7e25 Improve naming 2024-08-12 18:36:49 +02:00
Johan Walles
37cf840879 Fix a highlighting issue
Reported here:
https://github.com/walles/moar/issues/236#issuecomment-2282677792
2024-08-11 16:34:29 +02:00
Johan Walles
6cf1223634 Catch errors in goroutines and log them 2024-08-10 08:40:48 +02:00
Johan Walles
3b5b2ff31f Handle scrolling down while stream is loading
I don't know how this could work even without the stream loading, but
now it does.

Fixes #235.
2024-08-09 09:50:38 +02:00
Johan Walles
db41b5c946 Give tests more time on Windows
CI is slow on Windows.
2024-08-06 10:59:08 +02:00
Johan Walles
479d8970b2 Build tests in a separate step
To help the tests not time out.
2024-08-06 10:56:30 +02:00
Johan Walles
f7bdb720f3 Windows tests are slow
Give them enough time to not time out during CI.
2024-08-06 10:55:04 +02:00
Johan Walles
eafc0e2250 Use fallback if $EDITOR is not set
Fixes #232.

Note that vim as a pretty crappy fallback since it's so hard to use, but
I'm going with vim anyway for compatibility with less.
2024-08-06 10:50:31 +02:00
Johan Walles
eacddda29e Accept ^H as backspace when searching
Fixes #226.
2024-07-30 20:05:46 +02:00
Johan Walles
64352801a8
Merge pull request #229 from walles/johan/ci-upgrade
Bump to a newer setup-go version
2024-07-22 14:49:13 +02:00
Johan Walles
6e415f9a78 Bump to a newer setup-go version
And add a separate build step on Linux, so we're more comparable with
Windows. The extra build step will take some time, but it will also make
the next build step faster due to caching.
2024-07-22 13:19:59 +02:00
Johan Walles
ba0dc99445 Extend one of the tailing tests 2024-07-22 09:53:51 +02:00
Johan Walles
311ec98b94 Merge branch 'johan/tail-with-no-eof'
Fixes tailing files with no newline at end of file.

Yes, the branch name is wrong, it's EOL that's missing and nothing else.
2024-07-19 09:43:56 +02:00
Johan Walles
f97b7b8e71 Verify split-UTF-8-character handling while tailing
It already worked, but now we have a test confirming it.
2024-07-18 16:08:27 +02:00
Johan Walles
899998b4af Handle tailing no-newline-at-of files 2024-07-18 16:03:08 +02:00
Johan Walles
3a08bf62bb Add a test 2024-07-18 15:31:29 +02:00
Johan Walles
25c79625d5 Fill out the test a bit 2024-07-17 08:02:32 +02:00
Johan Walles
cec3daaf88 Mutexes not needed 2024-07-17 07:59:42 +02:00
Johan Walles
818c5229c0 Add a just-read test 2024-07-17 07:59:20 +02:00
Johan Walles
c89cecddd8 Fix a test failure on Windows 2024-07-17 00:40:57 +02:00
Johan Walles
0091a15268 Test the fancy interruptable reader
And add hints for any future Windows implementation.
2024-07-17 00:38:31 +02:00
Johan Walles
b77151e6b1 Add another test for the InterruptableReader 2024-07-17 00:24:50 +02:00
Johan Walles
002d188b49 Start adding tests for the interruptable reader 2024-07-17 00:18:36 +02:00
Johan Walles
f4fed36bfd Fix a hang
Before this change, if select() returned EINTR we would hang.

This change:
* Makes us ignore EINTRs and try again
* Makes sure to not hang, even if the twin main loop would fail for some
  other reason.
2024-07-15 20:30:47 +02:00
Johan Walles
27817741fc Fix a bytes counting race condition
Before this change, if the file grew after we read it, but before we
noted its size, then tailing could misbehave.
2024-07-15 07:03:06 +02:00
Johan Walles
a7d00c079f Verify byte counts as well 2024-07-15 06:53:41 +02:00
Johan Walles
d7dd3bd224
Merge pull request #225 from walles/johan/select-shutdown
Fancy shutdown
2024-07-14 12:28:43 +02:00
Johan Walles
00bb910b6f Provide implementation hints for Windows 2024-07-14 12:25:17 +02:00
Johan Walles
45480cf702 Don't start new reads when shutting down 2024-07-14 12:14:59 +02:00
Johan Walles
9c60483a35 Let Interrupt() wait for reader to react 2024-07-14 12:13:19 +02:00
Johan Walles
d3ed780152 Do fancy shutdown handling on Unix 2024-07-14 12:07:30 +02:00
Johan Walles
e0729105d6 Implement naive shutdown on Unix as well 2024-07-14 11:37:36 +02:00
Johan Walles
c30fb6d5a1 Do the platform agnostic part 2024-07-14 11:26:10 +02:00
Johan Walles
2a8a7701db Merge branch 'johan/tail-files'
Fixes #224.
2024-07-14 11:14:01 +02:00
Johan Walles
500b91fe60 Comment on fsnotify 2024-07-14 11:13:08 +02:00
Johan Walles
9cb47558e0 Self review changes 2024-07-14 11:07:00 +02:00
Johan Walles
62abdec926 The replace protection is not needed any more
Before, we used to highlight the buffer in the background, but we don't
do that any more, so we can't get new lines while highlighting any more.
2024-07-14 10:56:09 +02:00
Johan Walles
b29b5b237b Start fixing the tailing code 2024-07-14 10:40:40 +02:00
Johan Walles
68dd253ee6 We don't need this initially
If this not working would become a problem, let's fix it at that time.
2024-07-14 10:32:05 +02:00
Johan Walles
3f06a65d54 Implement file tailing 2024-07-14 10:29:05 +02:00
Johan Walles
f1d543e08e Track bytes consumed by the reader 2024-07-14 08:22:07 +02:00
Johan Walles
c3a05ae367 More tailing prep 2024-07-14 08:12:07 +02:00
Johan Walles
a1d219b785 Extract done reporting
This is prep for being able to reuse readStreamInternal() for adding
more lines later.
2024-07-14 08:06:32 +02:00
Johan Walles
886d561364 Stop passing around a member variable 2024-07-13 22:35:25 +02:00
Johan Walles
7ae3e9580a Avoid a function reference
They make code hard to follow.
2024-07-13 22:27:47 +02:00
Johan Walles
18acd3e092 Same test but with an initially empty file 2024-07-13 16:54:32 +02:00
Johan Walles
72b2451382 Add another test 2024-07-13 16:48:17 +02:00
Johan Walles
82e9ac0794 Test reading from files getting updated 2024-07-13 16:41:20 +02:00
Johan Walles
2097e7c01f We aren't doing filtering any more
We now have decompresion built in instead of trying to call external
binaries to do the work.
2024-07-13 16:03:44 +02:00
Johan Walles
eb7d1b92d1 Add go install to the manual install instructions
Inspired by https://github.com/walles/moar/issues/223.
2024-07-12 07:02:21 +02:00