diff src/syntax.c @ 2253:12ebd6f6dfce vim73

Fixed: after ":ownsyntax perl" and ":e" syntax was cleared in other window.
author Bram Moolenaar <bram@vim.org>
date Sun, 06 Jun 2010 16:11:09 +0200
parents a0b5918c33cc
children 8b3203df361f
line wrap: on
line diff
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -3421,6 +3421,21 @@ syntax_clear(block)
 }
 
 /*
+ * Get rid of ownsyntax for window "wp".
+ */
+    void
+reset_synblock(wp)
+    win_T *wp;
+{
+    if (wp->w_s != &wp->w_buffer->b_s)
+    {
+	syntax_clear(wp->w_s);
+	vim_free(wp->w_s);
+	wp->w_s = &wp->w_buffer->b_s;
+    }
+}
+
+/*
  * Clear syncing info for one buffer.
  */
     static void
@@ -3538,7 +3553,6 @@ syn_cmd_clear(eap, syncing)
 	    if (curwin->w_s == &curwin->w_buffer->b_s)
 		do_unlet((char_u *)"b:current_syntax", TRUE);
 	    do_unlet((char_u *)"w:current_syntax", TRUE);
-
 	}
     }
     else