mirror of
https://github.com/neovim/neovim.git
synced 2026-04-22 07:15:34 +00:00
vim-patch:9.2.0285: :syn sync grouphere may go beyond end of line (#38727)
Problem: :syn sync grouphere may go beyond end of line.
Solution: Start searching for the end of region at the end of match
instead of a possibly invalid position (zeertzjq).
closes: vim/vim#19896
b7cffc8434
This commit is contained in:
@@ -679,6 +679,8 @@ static void syn_sync(win_T *wp, linenr_T start_lnum, synstate_T *last_valid)
|
||||
// the next line.
|
||||
// For "groupthere" the parsing starts at start_lnum.
|
||||
if (found_flags & HL_SYNC_HERE) {
|
||||
current_lnum = found_m_endpos.lnum;
|
||||
current_col = found_m_endpos.col;
|
||||
if (!GA_EMPTY(¤t_state)) {
|
||||
cur_si = &CUR_STATE(current_state.ga_len - 1);
|
||||
cur_si->si_h_startpos.lnum = found_current_lnum;
|
||||
@@ -686,8 +688,6 @@ static void syn_sync(win_T *wp, linenr_T start_lnum, synstate_T *last_valid)
|
||||
update_si_end(cur_si, (int)current_col, true);
|
||||
check_keepend();
|
||||
}
|
||||
current_col = found_m_endpos.col;
|
||||
current_lnum = found_m_endpos.lnum;
|
||||
syn_finish_line(false);
|
||||
current_lnum++;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user