check_recorded_changes(
	buf_T		*buf,
	linenr_T	lnum,
	linenr_T	lnume,
	long		xtra)
{
    if (buf->b_recorded_changes != NULL && xtra != 0)
    {
	listitem_T *li;
	linenr_T    prev_lnum;
	linenr_T    prev_lnume;

	FOR_ALL_LIST_ITEMS(buf->b_recorded_changes, li)
	{
	    prev_lnum = (linenr_T)dict_get_number(
				      li->li_tv.vval.v_dict, (char_u *)"lnum");
	    prev_lnume = (linenr_T)dict_get_number(
				       li->li_tv.vval.v_dict, (char_u *)"end");
	    if (prev_lnum >= lnum || prev_lnum > lnume || prev_lnume >= lnum)
	    {
		// the current change is going to make the line number in
		// the older change invalid, flush now
		invoke_listeners(curbuf);
		break;
	    }
	}
    }
}
check_recorded_changes(
	buf_T		*buf,
	linenr_T	lnum,
	linenr_T	lnume,
	long		xtra)
{
    if (buf->b_recorded_changes != NULL && xtra != 0)
    {
	listitem_T *li;
	linenr_T    prev_lnum;
	linenr_T    prev_lnume;

	FOR_ALL_LIST_ITEMS(buf->b_recorded_changes, li)
	{
	    prev_lnum = (linenr_T)dict_get_number(
				      li->li_tv.vval.v_dict, (char_u *)"lnum");
	    prev_lnume = (linenr_T)dict_get_number(
				       li->li_tv.vval.v_dict, (char_u *)"end");
	    if (prev_lnum >= lnum || prev_lnum > lnume || prev_lnume >= lnum)
	    {
		 
		 
		invoke_listeners(curbuf);
		break;
	    }
	}
    }
}