]> granicus.if.org Git - vim/commitdiff
patch 7.4.1691 v7.4.1691
authorBram Moolenaar <Bram@vim.org>
Thu, 31 Mar 2016 21:02:16 +0000 (23:02 +0200)
committerBram Moolenaar <Bram@vim.org>
Thu, 31 Mar 2016 21:02:16 +0000 (23:02 +0200)
Problem:    When switching to a new buffer and an autocommand applies syntax
            highlighting an ml_get error may occur.
Solution:   Check "syn_buf" against the buffer in the window. (Alexander von
            Buddenbrock, closes #676)

src/syntax.c
src/version.c

index 29b68886b9634edec4ef2222b295454ca5b65f8c..a43f4a63a0da80aac0c5aa98bb72623425e3bbc6 100644 (file)
@@ -509,7 +509,9 @@ syntax_start(win_T *wp, linenr_T lnum)
      * Also do this when a change was made, the current state may be invalid
      * then.
      */
-    if (syn_block != wp->w_s || changedtick != syn_buf->b_changedtick)
+    if (syn_block != wp->w_s
+           || syn_buf != wp->w_buffer
+           || changedtick != syn_buf->b_changedtick)
     {
        invalidate_current_state();
        syn_buf = wp->w_buffer;
index 3fa82ca88627e6a2c8df10db299100fcee276eeb..d08e7307b6777da19e5a3a64412df56687578615 100644 (file)
@@ -748,6 +748,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1691,
 /**/
     1690,
 /**/