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:
@@ -3566,6 +3566,15 @@ adjust_text_props_for_delete(
|
|||||||
ml_delete(linenr_T lnum, int message)
|
ml_delete(linenr_T lnum, int message)
|
||||||
{
|
{
|
||||||
ml_flush_line(curbuf);
|
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);
|
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;
|
int textprop_save_len;
|
||||||
#endif
|
#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)
|
if (lowest_marked && lowest_marked > lnum)
|
||||||
lowest_marked--;
|
lowest_marked--;
|
||||||
|
|
||||||
|
@@ -777,6 +777,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1711,
|
||||||
/**/
|
/**/
|
||||||
1710,
|
1710,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user