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

335 Commits

Author SHA1 Message Date
Johan Walles
c8bc7b0161 Don't highlight files larger than 1MB
They make the highlighter just run in the background slowly eating up
memory.
2021-04-24 16:14:30 +02:00
Johan Walles
9e6af21106
Merge pull request #52 from 89z/master
DeInit: make output copy friendly
2021-04-24 09:22:14 +02:00
Steven Penny
63082a804d m/embed-api.go: fix formatting 2021-04-23 19:33:25 -05:00
Steven Penny
374378b979 DeInit: make output copy friendly
With DeInit turned off, the current output cannot be usefully copied, as no
newlines are emitted. Close the screen in all cases now, but if DeInit is
disabled, reprint the current buffer with newlines after the screen is closed.

Fixes #51
2021-04-23 19:24:05 -05:00
Johan Walles
d8644ed8e1 Add search performance benchmarks 2021-04-23 22:10:59 +02:00
Johan Walles
60b59c2483 Only install linters when needed
This makes most runs of ./test.sh quicker since they don't need to
invoke "go install".
2021-04-23 18:38:40 +02:00
Johan Walles
86ae632f14 Merge branch 'walles/async-highlight'
Do highlighting in the background. For large files, or files that are
slow to highlight, this removes the initial highlighting delay.
2021-04-23 06:52:56 +02:00
Johan Walles
232b784428 Fix tests 2021-04-22 22:05:36 +02:00
Johan Walles
c7a26137ef
Merge pull request #50 from 89z/master
Use CONIN$ for Windows screen setup
2021-04-22 21:39:14 +02:00
Steven Penny
0f9ae758d5 Use CONIN$ for Windows screen setup
Fixes #49
2021-04-22 14:03:22 -05:00
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