From 55159b7b39f8201967001e8381954f1d474d657a Mon Sep 17 00:00:00 2001
From: Benno Schulenberg <bensberg@justemail.net>
Date: Sun, 19 Mar 2017 17:13:29 +0100
Subject: [PATCH] painting: don't try to start highlighting before column zero

This could happen when a tab or a double-width character straddles
the boundary between two softwrapped chunks.
---
 src/winio.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/winio.c b/src/winio.c
index 7fbc1272..0b2abcbb 100644
--- a/src/winio.c
+++ b/src/winio.c
@@ -2624,6 +2624,9 @@ void edit_draw(filestruct *fileptr, const char *converted,
 	    /* Compute on which screen column to start painting. */
 	    start_col = strnlenpt(fileptr->data, top_x) - from_col;
 
+	    if (start_col < 0)
+		start_col = 0;
+
 	    thetext = converted + actual_x(converted, start_col);
 
 	    /* If the end of the mark is onscreen, compute how many
-- 
GitLab