From 96bb8149e98bbce37cdc021dfcbdbd9e3007668a Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Sun, 9 Aug 2020 16:49:24 +0200 Subject: [PATCH] moving: make go to the top when above the cursor all is blank Just like 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 were introduced. --- src/move.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/move.c b/src/move.c index 5f31b313..244ee419 100644 --- 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;