summaryrefslogtreecommitdiff
path: root/src/change.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-05-24 21:39:27 +0200
committerBram Moolenaar <Bram@vim.org>2019-05-24 21:39:27 +0200
commit7b31a181c84ec6b9050892e80f3132907569f8d8 (patch)
tree1d12931fd5662f6c266b6e7fdcc620d2c82d6437 /src/change.c
parentf0884c5f3f5a25481d1e16f0979aa978a6690bb1 (diff)
downloadvim-git-7b31a181c84ec6b9050892e80f3132907569f8d8.tar.gz
patch 8.1.1389: changes are not flushed when end and start overlapv8.1.1389
Problem: Changes are not flushed when end and start overlap. (Paul Jolly) Solution: When end of a previous changes overlaps with start of a new change, first flush listeners.
Diffstat (limited to 'src/change.c')
-rw-r--r--src/change.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/change.c b/src/change.c
index 8f0cacb45..0873dd3d8 100644
--- a/src/change.c
+++ b/src/change.c
@@ -172,16 +172,20 @@ check_recorded_changes(
if (buf->b_recorded_changes != NULL && xtra != 0)
{
listitem_T *li;
- linenr_T nr;
+ linenr_T prev_lnum;
+ linenr_T prev_lnume;
for (li = buf->b_recorded_changes->lv_first; li != NULL;
li = li->li_next)
{
- nr = (linenr_T)dict_get_number(
+ prev_lnum = (linenr_T)dict_get_number(
li->li_tv.vval.v_dict, (char_u *)"lnum");
- if (nr >= lnum || nr > lnume)
+ 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 && xtra != 0))
{
- if (li->li_next == NULL && lnum == nr
+ if (li->li_next == NULL && lnum == prev_lnum
&& col + 1 == (colnr_T)dict_get_number(
li->li_tv.vval.v_dict, (char_u *)"col"))
{
@@ -195,8 +199,8 @@ check_recorded_changes(
(char_u *)"end", -1);
if (di != NULL)
{
- nr = tv_get_number(&di->di_tv);
- if (lnume > nr)
+ prev_lnum = tv_get_number(&di->di_tv);
+ if (lnume > prev_lnum)
di->di_tv.vval.v_number = lnume;
}
di = dict_find(li->li_tv.vval.v_dict,