nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit 907ba3a2e2f19354870e029da1af80bc7d794bc2
parent 981b4149803ae3f4ec3b6fb018f1e5e86dfe25b0
Author: Benno Schulenberg <bensberg@justemail.net>
Date:   Mon, 25 Apr 2016 15:44:52 +0200

scrolling: catch the special case of reading a file from standard input

Since commit dac0aa1, nano would leave edittop at current after reading
data from standard input, meaning that everything that had been read in
was invisible, "scrolled off" the top of the screen.  Correct this by
explicitly setting edittop.

The above does not happen for ^R (^X) because it has a special mechanism
to save and restore edittop.  Nor does it happen for ^R ^X M-F because it
sets current to the top of the file and refreshing the screen will make
edittop follow, or -- in case just one unterminated line was read in --
edittop will already be equal to current.

Diffstat:
Msrc/nano.c | 2++
1 file changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/nano.c b/src/nano.c @@ -1167,6 +1167,8 @@ void finish_stdin_pager(void) nperror("fopen"); read_file(f, 0, "stdin", TRUE, FALSE); + openfile->edittop = openfile->fileage; + ttystdin = open("/dev/tty", O_RDONLY); if (!ttystdin) die(_("Couldn't reopen stdin from keyboard, sorry\n"));