Blob Blame History Raw
From c03f2cc36a2539316437cff4313823c0a0882473 Mon Sep 17 00:00:00 2001
From: Benno Schulenberg <bensberg@telfort.nl>
Date: Fri, 12 Apr 2019 14:00:14 +0200
Subject: [PATCH] unindent: ensure that a partial line gets displayed properly
 afterwards

When only the trailing chunk of a line is displayed on the top row of
the screen, and the unindenting of this line leads to a reduction in
the number of chunks, then the starting point of the viewport needs
to be re-evaluated.  For simplicity, do this always when something is
unindented.

This fixes https://savannah.gnu.org/bugs/?56102.
Reported-by: Devin Hussey <husseydevin@gmail.com>

Bug existed since around version 2.9.2.

Upstream-commit: 1c707d4f99cc919070104de09efe1e5a6302b6ce
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
---
 src/text.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/text.c b/src/text.c
index 6e730b6..eb0163e 100644
--- a/src/text.c
+++ b/src/text.c
@@ -443,6 +443,7 @@ void do_unindent(void)
 	}
 
 	set_modified();
+	ensure_firstcolumn_is_aligned();
 	refresh_needed = TRUE;
 	shift_held = TRUE;
 }
-- 
2.20.1