From 35686daf9de4b15b6e200f112d88f8f6ccd61ad8 Mon Sep 17 00:00:00 2001
From: Chris Allegretta <chrisa@asty.org>
Date: Sun, 8 Feb 2009 18:00:44 +0000
Subject: [PATCH]         * Make reset_multidata reset more lines, since
 contrary to previous problems the           syntax highlting is now too
 *un*ambitious, causing display glitches when           deleting a regex
 boundary.

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4373 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
---
 ChangeLog   |  3 +++
 src/color.c | 21 +++++++++++++++++++++
 2 files changed, 24 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 3d11a5cc..ea83190b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,7 @@
 2009-02-08 Chris Allegretta <chrisa@asty.org>
+	* Make reset_multidata reset more lines, since contrary to previous problems the
+	  syntax highlting is now too *un*ambitious, causing display glitches when
+	  deleting a regex boundary.
 	* Add more multidata initliazers for new buffers and 'magic lines'.  Fixes segfaults
 	  with syntax highlighting in new buffers, initially reported by Mike Frysinger.
 
diff --git a/src/color.c b/src/color.c
index 25c9603a..c20ace02 100644
--- a/src/color.c
+++ b/src/color.c
@@ -268,6 +268,16 @@ void reset_multis_after(filestruct *fileptr, int mindex)
 	else
 	    break;
     }
+    for (; oof != NULL; oof = oof->next) {
+	alloc_multidata_if_needed(oof);
+	if (oof->multidata == NULL)
+	    continue;
+	if (oof->multidata[mindex] == CNONE)
+	    oof->multidata[mindex] = -1;
+	else
+	    break;
+    }
+    edit_refresh_needed = TRUE;
 }
 
 void reset_multis_before(filestruct *fileptr, int mindex)
@@ -282,6 +292,17 @@ void reset_multis_before(filestruct *fileptr, int mindex)
 	else
 	    break;
     }
+    for (; oof != NULL; oof = oof->prev) {
+	alloc_multidata_if_needed(oof);
+	if (oof->multidata == NULL)
+	    continue;
+	if (oof->multidata[mindex] == CNONE)
+	    oof->multidata[mindex] = -1;
+	else
+	    break;
+    }
+
+    edit_refresh_needed = TRUE;
 }
 
 
-- 
GitLab