summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--desktop/textarea.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/desktop/textarea.c b/desktop/textarea.c
index 6a959d539..a1e46ddab 100644
--- a/desktop/textarea.c
+++ b/desktop/textarea.c
@@ -954,11 +954,15 @@ static bool textarea_reflow_multiline(struct textarea *ta,
if (start != 0)
start--;
+ /* During layout we may decide we need to restart again from the
+ * textarea's first line. */
do {
- /* Set line count to start point */
+ /* If a vertical scrollbar has been added or removed, we need
+ * to restart from the first line in the textarea. */
if (restart)
start = 0;
+ /* Set current line to the starting line */
line = start;
/* Find available width */