fix(diff): trigger on_bytes only once after diffget/diffput

Problem: The fix from b50ee4a8dc may
adjust extmark twice, triggering on_bytes callback twice.

Solution: Don't let mark_adjust adjust extmark.
This commit is contained in:
Jaehwang Jung
2023-03-11 16:52:46 +09:00
parent 236c20795e
commit 2748202e0e
2 changed files with 20 additions and 1 deletions

View File

@@ -3136,7 +3136,7 @@ static void diffgetput(const int addr_count, const int idx_cur, const int idx_fr
if (added != 0) {
// Adjust marks. This will change the following entries!
mark_adjust(lnum, lnum + count - 1, (long)MAXLNUM, added, kExtmarkUndo);
mark_adjust(lnum, lnum + count - 1, (long)MAXLNUM, added, kExtmarkNOOP);
if (curwin->w_cursor.lnum >= lnum) {
// Adjust the cursor position if it's in/after the changed
// lines.