changeset 52373:ddaae63bd193

(Fexpand_abbrev): Insert before deleting.
author Richard M. Stallman <rms@gnu.org>
date Fri, 29 Aug 2003 16:14:26 +0000
parents 02e7333fda5d
children 1b48f538540b
files src/abbrev.c
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/abbrev.c	Fri Aug 29 16:13:31 2003 +0000
+++ b/src/abbrev.c	Fri Aug 29 16:14:26 2003 +0000
@@ -356,10 +356,13 @@
     {
       SET_PT (wordstart);
 
-      del_range_both (wordstart, wordstart_byte, wordend, wordend_byte, 1);
-
       insert_from_string (expansion, 0, 0, SCHARS (expansion),
 			  SBYTES (expansion), 1);
+      del_range_both (PT, PT_BYTE,
+		      wordend + (PT - wordstart),
+		      wordend_byte + (PT_BYTE - wordstart_byte),
+		      1);
+
       SET_PT (PT + whitecnt);
 
       if (uccount && !lccount)