1
1
mirror of https://github.com/walles/moar.git synced 2024-09-21 09:01:30 +03:00
Commit Graph

325 Commits

Author SHA1 Message Date
Johan Walles
2c3cc80500 Don't use the plaintext highlighter 2021-04-22 19:31:47 +02:00
Johan Walles
095693eb0b Wait for highlighting to complete in pager tests 2021-04-22 19:26:29 +02:00
Johan Walles
488aaaab88 Highlight in the background
With this change in place, we first quickly get the file contents
without highlighting. Then, when the highlighting is done, the view gets
updated with the highlighted version.

Useful when you're loading long files where highlighting can take time.
2021-04-22 19:26:29 +02:00
Johan Walles
1359a3e558 Merge branch 'walles/test-mod-tidy-install'
Fixes #48 by doing "go mod tidy", getting linters using "go mod install"
and bumping to Go 1.16 to get everything working in CI.

Thanks for your research @89z!
2021-04-22 19:23:15 +02:00
Johan Walles
d51cd89e40 Remove not-needed-any-more check
Since we're getting our linters through "go install".
2021-04-22 19:20:27 +02:00
Johan Walles
19a5fe51c8 Try with Go 1.16 instead 2021-04-22 19:17:58 +02:00
Johan Walles
0a6db4974b Experiment with go mod tidy and go install
Try to work out #48.
2021-04-22 19:13:12 +02:00
Johan Walles
985bcce02c Move highlighting into its own file 2021-04-22 08:14:51 +02:00
Johan Walles
515000eec8 Add file reading benchmark 2021-04-22 07:56:10 +02:00
Johan Walles
c8e2d90ec5 Initial tests of highlighted lines count 2021-04-21 22:57:08 +02:00
Johan Walles
d24acdbf32 CI logs cosmetics 2021-04-21 08:32:31 +02:00
Johan Walles
ee3659e7f0 Fix master CI problem
https://travis-ci.com/github/walles/moar/jobs/500067810
2021-04-21 08:27:14 +02:00
Johan Walles
34299c42a2 Fix modules modification check 2021-04-21 08:24:55 +02:00
Johan Walles
97f5233080 Verify linters are listed in go.mod 2021-04-21 06:54:49 +02:00
Johan Walles
a211a28f49 Correct URL, take II 2021-04-21 06:29:34 +02:00
Johan Walles
2cf40d8f0a Correct URL 2021-04-21 06:25:52 +02:00
Johan Walles
f81f9d47d4 Require version number on v1.2.3 form
See #47.
2021-04-20 20:31:23 +02:00
Johan Walles
54942cf12e Less compatibility improvement
If we get both a filename and a pipe, prefer the filename.

For example, this will show the contents of /etc/passwd:

$ echo hello | moar /etc/passwd

Before this change, it displayed "hello" on a page.
2021-04-20 09:18:02 +02:00
Johan Walles
bc5e464147 Merge branch 'walles/errcheck' 2021-04-20 08:46:49 +02:00
Johan Walles
730ed46f4f Fix errcheck reported problems 2021-04-20 08:43:37 +02:00
Johan Walles
c93270e8fc Run errcheck from test.sh 2021-04-20 06:59:49 +02:00
Johan Walles
ad3a710c51 Merge branch 'walles/staticcheck' 2021-04-20 06:50:11 +02:00
Johan Walles
f8e658f0e3 Fix staticcheck reported errors 2021-04-20 06:46:14 +02:00
Johan Walles
c3936b44f4 Run staticcheck from test.sh 2021-04-20 06:46:14 +02:00
Johan Walles
8a5a4544cb Merge branch 'walles/linting' 2021-04-19 15:34:01 +02:00
Johan Walles
592d6da1dc Fix a docs error 2021-04-19 15:30:09 +02:00
Johan Walles
ccfe3d3b20 Run "go vet" as part of testing 2021-04-19 15:29:28 +02:00
Johan Walles
d122901ca8 Add gomft -s flag
Adds code simplifications. Recommended online somewhere.
2021-04-19 15:20:33 +02:00
Johan Walles
1e211974e1 Merge branch 'walles/enforce-formatting' 2021-04-19 08:45:29 +02:00
Johan Walles
40c7a473c9 Run all tests in the source tree
Changed from "run all tests in github.com/walles/moar/m"
2021-04-19 08:41:09 +02:00
Johan Walles
ede1a8cbb3 Verify code formatting in ./test.sh 2021-04-19 08:41:09 +02:00
Johan Walles
0795329ac5 Format sources on build, but not in CI 2021-04-18 21:59:38 +02:00
Johan Walles
44dc59d365 Better error message on paging to non-tty 2021-04-18 18:37:55 +02:00
Johan Walles
60da229cab Merge branch 'walles/drop-tcell'
* Fixes #37
* Fixes #34
* Replaces #44
* Makes window resizing smoother.

Before this change, the main loop was roughly:
* Await one single user input event
* Handle single user input event
* Redraw screen

With this change in place, the main loop is:
* Await one single user input event (like before)
* Handle single user input event (like before)
* If there are no more events, redraw screen (new!)

The difference is huge if you do a fling scroll on a trackpad. Before,
scrolling was slow at constant speed, and the scrolling kept on at that
slow constant speed way longer than what it should have. Now, scrolling
feels just like it should.
2021-04-18 16:10:14 +02:00
Johan Walles
39ab1fc93d Don't panic on no-piped-stdin on Windows 2021-04-18 13:33:13 +02:00
Johan Walles
2f0df183c7 Do "go build" on Windows, not just "go test" 2021-04-18 12:18:36 +02:00
Johan Walles
1b292fa050 Improve messaging 2021-04-18 07:45:41 +02:00
Johan Walles
4e8c49ea8d Warn about getting piped data on Windows 2021-04-18 07:36:13 +02:00
Johan Walles
1e46089cff Fix build errors on Unix 2021-04-17 22:29:45 +02:00
Johan Walles
ff9380fe15 Restore console settings when done 2021-04-17 22:29:45 +02:00
Johan Walles
9e0d48e866 Fix arrow keys handling 2021-04-17 22:29:45 +02:00
Johan Walles
9b86fc5736 Windows: Color output, character input
Arrow keys don't work.
2021-04-17 22:29:45 +02:00
Johan Walles
9f9dc37594 Remove a superfluous : 2021-04-17 22:29:45 +02:00
Johan Walles
e5ec2ce19a Open CONIN$ the usual way 2021-04-17 22:29:45 +02:00
Johan Walles
e72baff02e Try getting hold of the console on Windows 2021-04-17 22:29:45 +02:00
Johan Walles
90e374601d Use our new tcell replacement 2021-04-17 22:29:41 +02:00
Johan Walles
44a064c024 Write tcell replacement
Fixes #37 and fixes #34.
2021-04-17 22:24:40 +02:00
Johan Walles
26754cde93
Merge pull request #41 from 89z/master
m: make Page a method
2021-04-17 20:47:38 +02:00
Steven Penny
fed03bf413 Update Readme example 2021-04-17 13:00:59 -05:00
Steven Penny
8b9e7f104b Merge branch 'master' of https://github.com/walles/moar 2021-04-17 12:28:06 -05:00