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.
master
Benno Schulenberg 2020-08-09 16:49:24 +02:00
parent 07e69d54b2
commit 96bb8149e9
1 changed files with 2 additions and 2 deletions

View File

@ -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;