Commit 907ba3a2 authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

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

Since commit dac0aa1d, 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.
parent 981b4149
Showing with 2 additions and 0 deletions
+2 -0
......@@ -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"));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment