changeset 15113:ae25a1172514 v8.1.0567

patch 8.1.0567: error for NUL byte in ScreenLines goes unnoticed commit https://github.com/vim/vim/commit/4087bfd96d0d70791a1572ac4b40d5a655e2166b Author: Bram Moolenaar <Bram@vim.org> Date: Fri Dec 7 13:26:39 2018 +0100 patch 8.1.0567: error for NUL byte in ScreenLines goes unnoticed Problem: Error for NUL byte in ScreenLines goes unnoticed. Solution: Add an internal error message.
author Bram Moolenaar <Bram@vim.org>
date Fri, 07 Dec 2018 13:30:08 +0100
parents 71b114f291a8
children 87237010fcf9
files src/gui.c src/version.c
diffstat 2 files changed, 11 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/gui.c
+++ b/src/gui.c
@@ -2753,9 +2753,15 @@ gui_redraw_block(
 	}
 	else if (enc_utf8)
 	{
-	    // FIXME: how can the first character ever be zero?
-	    if (col1 > 0 && ScreenLines[off + col1] == 0)
-		--col1;
+	    if (ScreenLines[off + col1] == 0)
+	    {
+		if (col1 > 0)
+		    --col1;
+		else
+		    // FIXME: how can the first character ever be zero?
+		    IEMSGN("INTERNAL ERROR: NUL in ScreenLines in row %ld",
+								      gui.row);
+	    }
 # ifdef FEAT_GUI_GTK
 	    if (col2 + 1 < Columns && ScreenLines[off + col2 + 1] == 0)
 		++col2;
--- a/src/version.c
+++ b/src/version.c
@@ -793,6 +793,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    567,
+/**/
     566,
 /**/
     565,