lucc / nvimpager

Use nvim as a pager to view manpages, diffs, etc with nvim's syntax highlighting
Other
372 stars 20 forks source link

No output when launched with no input #17

Closed 3v1n0 closed 4 years ago

3v1n0 commented 4 years ago

If I just launch the command with no arguments, the UI is stopping and con Ctrl+C I'm getting:

^Ccat: /tmp/tmp.v4Vmkmf9h4: No such file or directory

lucc commented 4 years ago

Currently nvimpager reads stdin if no arguments are given. So technically the UI did not stop but is waiting for your input and an EOF (CTRL-D).

The error message comes from a bug that I hope is fixed in the last commit on develop: a79d7e2

One more point to note is that more and less both exit if no arguments and no text on stdin is given (if stdin is a tty). nvimpager in contrast does not check if stdin is a tty and just waits for text on stdin like cat does. Maybe nvimpager should behave like more & less in this case. I have to think about that.