diff options
author | Shougo Matsushita <Shougo.Matsu@gmail.com> | 2016-11-22 07:31:40 +0900 |
---|---|---|
committer | Shougo Matsushita <Shougo.Matsu@gmail.com> | 2016-11-24 07:07:22 +0900 |
commit | 5c06f350cee4d52554194a90e1d070f4f53979d3 (patch) | |
tree | f57c6876c972c5897afef44902ed0db39cd6afef /src/nvim/syntax.c | |
parent | 5f0260808cf3712718555ee177476b8aefd78280 (diff) | |
download | rneovim-5c06f350cee4d52554194a90e1d070f4f53979d3.tar.gz rneovim-5c06f350cee4d52554194a90e1d070f4f53979d3.tar.bz2 rneovim-5c06f350cee4d52554194a90e1d070f4f53979d3.zip |
vim-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 vim/vim#676)
https://github.com/vim/vim/commit/b681be175b6991cdc2b8ddd49b0e97e3fe2b201e
Diffstat (limited to 'src/nvim/syntax.c')
-rw-r--r-- | src/nvim/syntax.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c index e57965ac2c..cd37bde3cb 100644 --- a/src/nvim/syntax.c +++ b/src/nvim/syntax.c @@ -392,7 +392,9 @@ void 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; syn_block = wp->w_s; |