diff src/change.c @ 18434:5da355d15b88 v8.1.2211

patch 8.1.2211: listener callback "added" argument is not the total Commit: https://github.com/vim/vim/commit/336bf2b8b269e2591576b9f580e79edb93e23c62 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Oct 24 20:07:07 2019 +0200 patch 8.1.2211: listener callback "added" argument is not the total Problem: Listener callback "added" argument is not the total. (Andy Massimino) Solution: Compute the total. (closes #5105)
author Bram Moolenaar <Bram@vim.org>
date Thu, 24 Oct 2019 20:15:03 +0200
parents fe5afdc03bd2
children d6cb1e706fb7
line wrap: on
line diff
--- a/src/change.c
+++ b/src/change.c
@@ -371,9 +371,9 @@ invoke_listeners(buf_T *buf)
 	if (start > lnum)
 	    start = lnum;
 	lnum = dict_get_number(li->li_tv.vval.v_dict, (char_u *)"end");
-	if (lnum > end)
+	if (end < lnum)
 	    end = lnum;
-	added = dict_get_number(li->li_tv.vval.v_dict, (char_u *)"added");
+	added += dict_get_number(li->li_tv.vval.v_dict, (char_u *)"added");
     }
     argv[1].v_type = VAR_NUMBER;
     argv[1].vval.v_number = start;