mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
insert_enter: Update folds on insert-leave. #5351
Fixes failing test: 045_folding_spec.lua References #5299
This commit is contained in:
parent
19b47b043d
commit
e1079c2a28
@ -462,6 +462,8 @@ static void insert_enter(InsertState *s)
|
||||
o_lnum = curwin->w_cursor.lnum;
|
||||
}
|
||||
|
||||
foldUpdateAll(curwin);
|
||||
foldOpenCursor();
|
||||
if (s->cmdchar != 'r' && s->cmdchar != 'v') {
|
||||
apply_autocmds(EVENT_INSERTLEAVE, NULL, NULL, false, curbuf);
|
||||
}
|
||||
|
@ -765,12 +765,8 @@ void foldUpdate(win_T *wp, linenr_T top, linenr_T bot)
|
||||
return;
|
||||
}
|
||||
|
||||
fold_T *fp;
|
||||
if (wp->w_buffer->terminal) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Mark all folds from top to bot as maybe-small.
|
||||
fold_T *fp;
|
||||
(void)foldFind(&wp->w_folds, top, &fp);
|
||||
while (fp < (fold_T *)wp->w_folds.ga_data + wp->w_folds.ga_len
|
||||
&& fp->fd_top < bot) {
|
||||
|
@ -5924,6 +5924,9 @@ static void nv_replace(cmdarg_T *cap)
|
||||
curwin->w_set_curswant = true;
|
||||
set_last_insert(cap->nchar);
|
||||
}
|
||||
|
||||
foldUpdateAll(curwin);
|
||||
foldOpenCursor();
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user