walles / moar

Moar is a pager. It's designed to just do the right thing without any configuration.
Other
600 stars 17 forks source link

Replace tcell with roll-our-own #42

Closed walles closed 3 years ago

walles commented 3 years ago

Before this change, the main loop was roughly:

With this change in place, the main loop is:

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.

walles commented 3 years ago

@89z could you test this on Windows?

If you could just build moar from this branch and try using it to view some file that would be swell!

You provided Windows screenshots in #33 so I assume you have a Windows machine with a Go environment set up.

walles commented 3 years ago

@89z thanks!

I excluded SIGWINCH handling on Windows, if you could make another try that would be awesome!

walles commented 3 years ago

Build + unit testing now pass on Windows, I added a Travis config so any breakage should become obvious.

Could still be visually all-broken though, needs testing by a human on an actual Windows machine.

Just starting moar on some file and verifying...

... should cover most Windows specific cases.

walles commented 3 years ago

I think it's because of this, no explicit access to /dev/stdout is ever done:

https://github.com/walles/moar/blob/7cd157174c028049ffa87c4b230a578c67a5481b/twin/screen.go#L105-L114

I'll see if I can figure out some way of testing this on Windows somehow.

walles commented 3 years ago

Found a Windows machine, will fix things up there.