From bd770ea2e777980b31a821d3db1ab07062137374 Mon Sep 17 00:00:00 2001
From: Benno Schulenberg <bensberg@telfort.nl>
Date: Wed, 16 Aug 2017 16:32:18 +0200
Subject: [PATCH] text: properly unindent lines that consist of only whitespace

The preceding 'for' loop has already established that all the lines are
either unindentable or composed of only blanks.  So if now a line cannot
be unindented, it means it is fully blank, so it can be simply skipped.

This fixes https://savannah.gnu.org/bugs/?51760.
Reported-by: David Lawrence Ramsey <pooka109@gmail.com>
---
 src/text.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/text.c b/src/text.c
index 558cda7d..49a18244 100644
--- a/src/text.c
+++ b/src/text.c
@@ -413,7 +413,7 @@ void do_unindent(void)
 	size_t indent_len = length_of_white(f->data);
 
 	/* If the line consists of a small amount of whitespace, skip it. */
-	if (white_string(f->data) && indent_len < tabsize)
+	if (indent_len == 0)
 	    continue;
 
 	/* Remove the first tab's worth of whitespace from this line. */
-- 
GitLab