diff src/syntax.c @ 26:404aac550f35 v7.0017

updated for version 7.0017
author vimboss
date Thu, 07 Oct 2004 21:02:47 +0000
parents 8ff7fd162d3c
children 125e80798a85
line wrap: on
line diff
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -437,17 +437,21 @@ syntax_start(wp, lnum)
     linenr_T	parsed_lnum;
     linenr_T	first_stored;
     int		dist;
+    static int	changedtick = 0;	/* remember the last change ID */
 
     reg_syn = TRUE;	/* let vim_regexec() know we're using syntax */
 
     /*
      * After switching buffers, invalidate current_state.
+     * Also do this when a change was made, the current state may be invalid
+     * then.
      */
-    if (syn_buf != wp->w_buffer)
+    if (syn_buf != wp->w_buffer || changedtick != syn_buf->b_changedtick)
     {
 	invalidate_current_state();
 	syn_buf = wp->w_buffer;
     }
+    changedtick = syn_buf->b_changedtick;
     syn_win = wp;
 
     /*
@@ -7392,7 +7396,7 @@ get_attr_entry(table, aep)
 	return i + ATTR_OFF;
     }
 
-    if (table->ga_len + ATTR_OFF == 256)
+    if (table->ga_len + ATTR_OFF >= 256)
     {
 	/*
 	 * Running out of attribute entries!  remove all attributes, and