diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-04-17 03:54:28 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-17 03:54:28 +0800 |
commit | dcf7bc414037c888dbc4003caf9e28ffb0f7d4e2 (patch) | |
tree | 37c622da44efe8d39dda9ed4d8ab40240c703bef /src/nvim/syntax.c | |
parent | 3f2e9298bdd971a4d2baa298aff7c6f2c2c1ad1a (diff) | |
download | rneovim-dcf7bc414037c888dbc4003caf9e28ffb0f7d4e2.tar.gz rneovim-dcf7bc414037c888dbc4003caf9e28ffb0f7d4e2.tar.bz2 rneovim-dcf7bc414037c888dbc4003caf9e28ffb0f7d4e2.zip |
vim-patch:8.2.4762: using freed memory using synstack() and synID() in WinEnter (#18136)
Problem: Using freed memory when using synstack() and synID() in WinEnter.
Solution: Check using the syntax window. (closes vim/vim#10204)
https://github.com/vim/vim/commit/ca7e86c23789eb0ed8f6400f25ea9e0e1036f9fc
Diffstat (limited to 'src/nvim/syntax.c')
-rw-r--r-- | src/nvim/syntax.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c index d884ad704b..0ceb66f438 100644 --- a/src/nvim/syntax.c +++ b/src/nvim/syntax.c @@ -5802,8 +5802,8 @@ char_u *get_syntax_name(expand_T *xp, int idx) int syn_get_id(win_T *wp, long lnum, colnr_T col, int trans, bool *spellp, int keep_state) { // When the position is not after the current position and in the same - // line of the same buffer, need to restart parsing. - if (wp->w_buffer != syn_buf || lnum != current_lnum || col < current_col) { + // line of the same window with the same buffer, need to restart parsing. + if (wp != syn_win || wp->w_buffer != syn_buf || lnum != current_lnum || col < current_col) { syntax_start(wp, lnum); } else if (col > current_col) { // next_match may not be correct when moving around, e.g. with the |