0
0
mirror of https://github.com/vim/vim.git synced 2025-10-07 05:54:16 -04:00

patch 8.1.1711: listener callback called at the wrong moment

Problem:    Listener callback called at the wrong moment
Solution:   Invoke listeners before calling ml_delete_int(). (closes #4657)
This commit is contained in:
Bram Moolenaar
2019-07-17 22:55:35 +02:00
parent 4a0a161a9b
commit acf7544cf6
2 changed files with 11 additions and 8 deletions

View File

@@ -3566,6 +3566,15 @@ adjust_text_props_for_delete(
ml_delete(linenr_T lnum, int message)
{
ml_flush_line(curbuf);
if (lnum < 1 || lnum > curbuf->b_ml.ml_line_count)
return FAIL;
#ifdef FEAT_EVAL
// When inserting above recorded changes: flush the changes before changing
// the text.
may_invoke_listeners(curbuf, lnum, lnum + 1, -1);
#endif
return ml_delete_int(curbuf, lnum, message);
}
@@ -3590,14 +3599,6 @@ ml_delete_int(buf_T *buf, linenr_T lnum, int message)
int textprop_save_len;
#endif
if (lnum < 1 || lnum > buf->b_ml.ml_line_count)
return FAIL;
#ifdef FEAT_EVAL
// When inserting above recorded changes: flush the changes before changing
// the text.
may_invoke_listeners(buf, lnum, lnum + 1, -1);
#endif
if (lowest_marked && lowest_marked > lnum)
lowest_marked--;

View File

@@ -777,6 +777,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1711,
/**/
1710,
/**/