nano

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

commit 96bb8149e98bbce37cdc021dfcbdbd9e3007668a
parent 07e69d54b21028a4f3ae02df973ad8ae7541bc00
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Sun,  9 Aug 2020 16:49:24 +0200

moving: make <Ctrl+Up> go to the top when above the cursor all is blank

Just like <Ctrl+Down> goes to the end of the buffer when after the
cursor there are only blank lines.

This fixes https://savannah.gnu.org/bugs/?58921.

Bug existed since version 2.6.2, since <Ctrl+Up/Down> were introduced.

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

diff --git a/src/move.c b/src/move.c @@ -234,8 +234,8 @@ void to_prev_block(void) seen_text = seen_text || is_text; } - /* Step forward one line again if this one is blank. */ - if (openfile->current->next != NULL && + /* Step forward one line again if we passed text but this line is blank. */ + if (seen_text && openfile->current->next != NULL && white_string(openfile->current->data)) openfile->current = openfile->current->next;