Mercurial > emacs
comparison src/insdel.c @ 45818:e70fd49212a0
(insert_1_both, insert_from_string_1)
(insert_from_buffer_1): Recalculate END_UNCHANGED in case the
insert happened in the end_unchanged region. Otherwise, the
redisplay may be confused and duplicate the last line in the
buffer [seen after save-buffer when require-final-newline==t].
author | Kim F. Storm <storm@cua.dk> |
---|---|
date | Thu, 13 Jun 2002 22:07:13 +0000 |
parents | a4b638169822 |
children | 1fb8f75062c6 |
comparison
equal
deleted
inserted
replaced
45817:3a276adf4d80 | 45818:e70fd49212a0 |
---|---|
1029 if (GAP_SIZE > 0) *(GPT_ADDR) = 0; /* Put an anchor. */ | 1029 if (GAP_SIZE > 0) *(GPT_ADDR) = 0; /* Put an anchor. */ |
1030 | 1030 |
1031 if (GPT_BYTE < GPT) | 1031 if (GPT_BYTE < GPT) |
1032 abort (); | 1032 abort (); |
1033 | 1033 |
1034 /* The insert may have been in the unchanged region, so check again. */ | |
1035 if (Z - GPT < END_UNCHANGED) | |
1036 END_UNCHANGED = Z - GPT; | |
1037 | |
1034 adjust_overlays_for_insert (PT, nchars); | 1038 adjust_overlays_for_insert (PT, nchars); |
1035 adjust_markers_for_insert (PT, PT_BYTE, | 1039 adjust_markers_for_insert (PT, PT_BYTE, |
1036 PT + nchars, PT_BYTE + nbytes, | 1040 PT + nchars, PT_BYTE + nbytes, |
1037 before_markers); | 1041 before_markers); |
1038 | 1042 |
1152 if (GAP_SIZE > 0) *(GPT_ADDR) = 0; /* Put an anchor. */ | 1156 if (GAP_SIZE > 0) *(GPT_ADDR) = 0; /* Put an anchor. */ |
1153 | 1157 |
1154 if (GPT_BYTE < GPT) | 1158 if (GPT_BYTE < GPT) |
1155 abort (); | 1159 abort (); |
1156 | 1160 |
1161 /* The insert may have been in the unchanged region, so check again. */ | |
1162 if (Z - GPT < END_UNCHANGED) | |
1163 END_UNCHANGED = Z - GPT; | |
1164 | |
1157 adjust_overlays_for_insert (PT, nchars); | 1165 adjust_overlays_for_insert (PT, nchars); |
1158 adjust_markers_for_insert (PT, PT_BYTE, PT + nchars, | 1166 adjust_markers_for_insert (PT, PT_BYTE, PT + nchars, |
1159 PT_BYTE + outgoing_nbytes, | 1167 PT_BYTE + outgoing_nbytes, |
1160 before_markers); | 1168 before_markers); |
1161 | 1169 |
1298 Z_BYTE += outgoing_nbytes; | 1306 Z_BYTE += outgoing_nbytes; |
1299 if (GAP_SIZE > 0) *(GPT_ADDR) = 0; /* Put an anchor. */ | 1307 if (GAP_SIZE > 0) *(GPT_ADDR) = 0; /* Put an anchor. */ |
1300 | 1308 |
1301 if (GPT_BYTE < GPT) | 1309 if (GPT_BYTE < GPT) |
1302 abort (); | 1310 abort (); |
1311 | |
1312 /* The insert may have been in the unchanged region, so check again. */ | |
1313 if (Z - GPT < END_UNCHANGED) | |
1314 END_UNCHANGED = Z - GPT; | |
1303 | 1315 |
1304 adjust_overlays_for_insert (PT, nchars); | 1316 adjust_overlays_for_insert (PT, nchars); |
1305 adjust_markers_for_insert (PT, PT_BYTE, PT + nchars, | 1317 adjust_markers_for_insert (PT, PT_BYTE, PT + nchars, |
1306 PT_BYTE + outgoing_nbytes, | 1318 PT_BYTE + outgoing_nbytes, |
1307 0); | 1319 0); |