From: Eli Zaretskii Date: Thu, 18 Jul 2024 09:59:28 +0000 (+0300) Subject: Minor cleanup of code in insdel.c X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=85c0ed4a0f5fbce07544c8c03885623299567c19;p=emacs.git Minor cleanup of code in insdel.c * src/insdel.c (del_range_2): Update *_BYTE variables _after_ updating the corresponding character values. This follows what we do everywhere else, and allows to put a watchpoint on, say, Z_BYTE to check consistency between the character and byte counts. See bug#72165 for one situation where it is useful. (cherry picked from commit a90a1ed527e89cf26737b6a123070c55c3118923) --- diff --git a/src/insdel.c b/src/insdel.c index c450959eec6..26ad14948ce 100644 --- a/src/insdel.c +++ b/src/insdel.c @@ -1929,10 +1929,10 @@ del_range_2 (ptrdiff_t from, ptrdiff_t from_byte, offset_intervals (current_buffer, from, - nchars_del); GAP_SIZE += nbytes_del; - ZV_BYTE -= nbytes_del; - Z_BYTE -= nbytes_del; ZV -= nchars_del; Z -= nchars_del; + ZV_BYTE -= nbytes_del; + Z_BYTE -= nbytes_del; GPT = from; GPT_BYTE = from_byte; if (GAP_SIZE > 0 && !current_buffer->text->inhibit_shrinking)