mirror of
https://github.com/neovim/neovim.git
synced 2024-12-20 11:15:14 -07:00
vim-patch:9.0.0750: crash when popup closed in callback (#20659)
Problem: Crash when popup closed in callback. (Maxim Kim)
Solution: In syntax_end_parsing() check that syn_block is valid.
0abd6cf62d
This commit is contained in:
parent
cb7da02701
commit
1c478391ca
@ -1753,7 +1753,7 @@ win_update_start:
|
||||
// Let the syntax stuff know we skipped a few lines.
|
||||
if (syntax_last_parsed != 0 && syntax_last_parsed + 1 < lnum
|
||||
&& syntax_present(wp)) {
|
||||
syntax_end_parsing(syntax_last_parsed + 1);
|
||||
syntax_end_parsing(wp, syntax_last_parsed + 1);
|
||||
}
|
||||
|
||||
// Display one line
|
||||
@ -1827,7 +1827,7 @@ win_update_start:
|
||||
|
||||
// Let the syntax stuff know we stop parsing here.
|
||||
if (syntax_last_parsed != 0 && syntax_present(wp)) {
|
||||
syntax_end_parsing(syntax_last_parsed + 1);
|
||||
syntax_end_parsing(wp, syntax_last_parsed + 1);
|
||||
}
|
||||
|
||||
// If we didn't hit the end of the file, and we didn't finish the last
|
||||
|
@ -1327,10 +1327,13 @@ static bool syn_stack_equal(synstate_T *sp)
|
||||
// displayed line
|
||||
// displayed line
|
||||
// lnum -> line below window
|
||||
void syntax_end_parsing(linenr_T lnum)
|
||||
void syntax_end_parsing(win_T *wp, linenr_T lnum)
|
||||
{
|
||||
synstate_T *sp;
|
||||
|
||||
if (syn_block != wp->w_s) {
|
||||
return; // not the right window
|
||||
}
|
||||
sp = syn_stack_find_entry(lnum);
|
||||
if (sp != NULL && sp->sst_lnum < lnum) {
|
||||
sp = sp->sst_next;
|
||||
|
Loading…
Reference in New Issue
Block a user