diff options
author | Bram Moolenaar <Bram@vim.org> | 2016-03-31 23:02:16 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2016-03-31 23:02:16 +0200 |
commit | b681be175b6991cdc2b8ddd49b0e97e3fe2b201e (patch) | |
tree | 854198068286dbd25e5496ffcb0e7b5920bc27fc | |
parent | 42356150badca33b4e42dc8172abbceff2e86cbe (diff) | |
download | vim-git-b681be175b6991cdc2b8ddd49b0e97e3fe2b201e.tar.gz |
patch 7.4.1691v7.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)
-rw-r--r-- | src/syntax.c | 4 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/syntax.c b/src/syntax.c index 29b68886b..a43f4a63a 100644 --- a/src/syntax.c +++ b/src/syntax.c @@ -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; diff --git a/src/version.c b/src/version.c index 3fa82ca88..d08e7307b 100644 --- a/src/version.c +++ b/src/version.c @@ -749,6 +749,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1691, +/**/ 1690, /**/ 1689, |