Skip to content

Commit b681be1

Browse files
committed
patch 7.4.1691
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)
1 parent 4235615 commit b681be1

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/syntax.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,9 @@ syntax_start(win_T *wp, linenr_T lnum)
509509
* Also do this when a change was made, the current state may be invalid
510510
* then.
511511
*/
512-
if (syn_block != wp->w_s || changedtick != syn_buf->b_changedtick)
512+
if (syn_block != wp->w_s
513+
|| syn_buf != wp->w_buffer
514+
|| changedtick != syn_buf->b_changedtick)
513515
{
514516
invalidate_current_state();
515517
syn_buf = wp->w_buffer;

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -748,6 +748,8 @@ static char *(features[]) =
748748

749749
static int included_patches[] =
750750
{ /* Add new patch number below this line */
751+
/**/
752+
1691,
751753
/**/
752754
1690,
753755
/**/

0 commit comments

Comments
 (0)