From 167c93b85ca43da6c52bbc11522ddab5582197e4 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Sun, 7 Nov 2021 15:15:35 +0100 Subject: [PATCH] justify: correctly determine whether top-of-buffer has been reached The text to be justified has been excised from the buffer and is now in the cutbuffer, so we cannot compare any of its lines to 'filetop'. This fixes https://savannah.gnu.org/bugs/?61438. Bug existed since version 4.0, commit 14c08589. --- src/text.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/text.c b/src/text.c index fb40aa6b..bb5625e8 100644 --- a/src/text.c +++ b/src/text.c @@ -1467,7 +1467,7 @@ bool begpar(const linestruct *const line, int depth) /* If this is the very first line of the buffer, it counts as a BOP * even when it contains no text. */ - if (line == openfile->filetop) + if (line->prev == NULL) return TRUE; /* If recursion is going too deep, just say it's not a BOP. */