markbt / streampager

A pager for command output or large files
MIT License
45 stars 11 forks source link

Tweaks for less compatibility #14

Closed quark-zju closed 4 years ago

quark-zju commented 4 years ago

Some tweaks to make sp more familiar to less users.

markbt commented 4 years ago

I really don't like less's behaviour that prevents you from scrolling past the end of the file. It's still possible to scroll past the end anyway (e.g. by searching), and I often find it useful to do so (e.g. to line things up on my terminal). I'd prefer not to adopt that.

The other stuff is fine. I wasn't aiming for less/vim compatibility, but I understand some people have muscle memory for these things.

quark-zju commented 4 years ago

I think it depends on whether the alternate screen is used. When it's not used it seems cleaner not having the "~" left on screen at exit. I'm used to the less -F -X behavior. I'll make it an option then.

quark-zju commented 4 years ago

I made it a config option that can be set via SP_SCROLL_PAST_EOF. It defaults to true, preserving the existing behavior.

(This is now based on #13, so I don't need to rebase back and forth)

markbt commented 4 years ago

Looks good. I'll merge after #13 for simplicity.