commit bd770ea2e777980b31a821d3db1ab07062137374
parent c3de3ece32fb0918ce9f89ae986d79b4024c40db
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Wed, 16 Aug 2017 16:32:18 +0200
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>
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git 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. */