Mercurial > emacs
comparison src/insdel.c @ 106222:35b575add861
(adjust_markers_for_delete): Move it in the right direction! (bug#4803)
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Tue, 24 Nov 2009 21:33:23 +0000 |
parents | f2cea199b0c4 |
children | 1d1d5d9bd884 |
comparison
equal
deleted
inserted
replaced
106221:6c0524d168f6 | 106222:35b575add861 |
---|---|
368 if (! m->insertion_type) | 368 if (! m->insertion_type) |
369 { /* Normal markers will end up at the beginning of the | 369 { /* Normal markers will end up at the beginning of the |
370 re-inserted text after undoing a deletion, and must be | 370 re-inserted text after undoing a deletion, and must be |
371 adjusted to move them to the correct place. */ | 371 adjusted to move them to the correct place. */ |
372 XSETMISC (marker, m); | 372 XSETMISC (marker, m); |
373 record_marker_adjustment (marker, from - charpos); | 373 record_marker_adjustment (marker, from - charpos); |
374 } | 374 } |
375 else if (charpos < to) | 375 else if (charpos < to) |
376 { /* Before-insertion markers will automatically move forward | 376 { /* Before-insertion markers will automatically move forward |
377 upon re-inserting the deleted text, so we have to arrange | 377 upon re-inserting the deleted text, so we have to arrange |
378 for them to move backward to the correct position. */ | 378 for them to move backward to the correct position. */ |
379 XSETMISC (marker, m); | 379 XSETMISC (marker, m); |
380 record_marker_adjustment (marker, charpos - to); | 380 record_marker_adjustment (marker, to - charpos); |
381 } | 381 } |
382 m->charpos = from; | 382 m->charpos = from; |
383 m->bytepos = from_byte; | 383 m->bytepos = from_byte; |
384 } | 384 } |
385 /* Here's the case where a before-insertion marker is immediately | 385 /* Here's the case where a before-insertion marker is immediately |