comparison src/syntax.c @ 8806:8fff73f17ff1 v7.4.1691

commit https://github.com/vim/vim/commit/b681be175b6991cdc2b8ddd49b0e97e3fe2b201e Author: Bram Moolenaar <Bram@vim.org> Date: Thu Mar 31 23:02:16 2016 +0200 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)
author Christian Brabandt <cb@256bit.org>
date Thu, 31 Mar 2016 23:15:05 +0200
parents 24b43dd167eb
children 50d9fb580ffe
comparison
equal deleted inserted replaced
8805:6d8b4fe96454 8806:8fff73f17ff1
507 /* 507 /*
508 * After switching buffers, invalidate current_state. 508 * After switching buffers, invalidate current_state.
509 * Also do this when a change was made, the current state may be invalid 509 * Also do this when a change was made, the current state may be invalid
510 * then. 510 * then.
511 */ 511 */
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)
513 { 515 {
514 invalidate_current_state(); 516 invalidate_current_state();
515 syn_buf = wp->w_buffer; 517 syn_buf = wp->w_buffer;
516 syn_block = wp->w_s; 518 syn_block = wp->w_s;
517 } 519 }