nano

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

commit 255f5478e4c5973560539ca6dd9c999b1b00105c
parent 2a7c9b7f62b3fb303501c803b28789bf0e7e5185
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Tue, 18 Jul 2017 21:15:35 +0200

startup: in default mode, display the tail of the file as Pico does

When not using --smooth (nor 'set smooth'), and a line near or beyond
the end-of-file is addressed with the + command-line argument, then
center the cursor, just like Pico does -- so in the default mode,
nano is again more like Pico.

This partially addresses https://savannah.gnu.org/bugs/?51489.

Diffstat:
Msrc/search.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/search.c b/src/search.c @@ -912,7 +912,7 @@ void do_gotolinecolumn(ssize_t line, ssize_t column, bool use_answer, /* If the target line is close to the tail of the file, put the last * line or chunk on the bottom line of the screen; otherwise, just * center the target line. */ - if (rows_from_tail < editwinrows / 2) { + if (rows_from_tail < editwinrows / 2 && ISSET(SMOOTH_SCROLL)) { openfile->current_y = editwinrows - 1 - rows_from_tail; adjust_viewport(STATIONARY); } else