comparison src/insdel.c @ 23212:42fcd022d4e5

(adjust_after_replace): Don't add combining bytes to the args given to adjust_point. Handle correctly the case that there are both before and after combining bytes. (replace_range): Likewise.
author Kenichi Handa <handa@m17n.org>
date Tue, 08 Sep 1998 02:01:59 +0000
parents a4e688757109
children a3f818e927ba
comparison
equal deleted inserted replaced
23211:d7bd20e02b1d 23212:42fcd022d4e5
1634 1634
1635 { 1635 {
1636 int pos = PT, pos_byte = PT_BYTE; 1636 int pos = PT, pos_byte = PT_BYTE;
1637 1637
1638 if (from < PT) 1638 if (from < PT)
1639 adjust_point (len - nchars_del + combined_after_bytes, 1639 adjust_point (len - nchars_del, len_byte - nbytes_del);
1640 len_byte - nbytes_del + combined_after_bytes);
1641 else if (from == PT && combined_before_bytes)
1642 adjust_point (0, combined_before_bytes);
1643 1640
1644 if (combined_after_bytes) 1641 if (combined_after_bytes)
1645 combine_bytes (from + len, from_byte + len_byte, combined_after_bytes); 1642 {
1643 if (combined_before_bytes)
1644 combined_before_bytes += combined_after_bytes;
1645 else
1646 combine_bytes (from + len, from_byte + len_byte,
1647 combined_after_bytes);
1648 }
1646 1649
1647 if (combined_before_bytes) 1650 if (combined_before_bytes)
1648 combine_bytes (from, from_byte, combined_before_bytes); 1651 combine_bytes (from, from_byte, combined_before_bytes);
1649 } 1652 }
1650 1653
1885 current_buffer, inherit); 1888 current_buffer, inherit);
1886 #endif 1889 #endif
1887 1890
1888 /* Relocate point as if it were a marker. */ 1891 /* Relocate point as if it were a marker. */
1889 if (from < PT) 1892 if (from < PT)
1890 adjust_point ((from + inschars - (PT < to ? PT : to) 1893 adjust_point ((from + inschars - (PT < to ? PT : to)),
1891 + combined_after_bytes),
1892 (from_byte + outgoing_insbytes 1894 (from_byte + outgoing_insbytes
1893 - (PT_BYTE < to_byte ? PT_BYTE : to_byte) 1895 - (PT_BYTE < to_byte ? PT_BYTE : to_byte)));
1894 + combined_after_bytes));
1895 1896
1896 if (combined_after_bytes) 1897 if (combined_after_bytes)
1897 combine_bytes (from + inschars, from_byte + outgoing_insbytes, 1898 {
1898 combined_after_bytes); 1899 if (combined_before_bytes)
1899 1900 combined_before_bytes += combined_after_bytes;
1901 else
1902 combine_bytes (from + inschars, from_byte + outgoing_insbytes,
1903 combined_after_bytes);
1904 }
1900 if (combined_before_bytes) 1905 if (combined_before_bytes)
1901 combine_bytes (from, from_byte, combined_before_bytes); 1906 combine_bytes (from, from_byte, combined_before_bytes);
1902 1907
1903 if (outgoing_insbytes == 0) 1908 if (outgoing_insbytes == 0)
1904 evaporate_overlays (from); 1909 evaporate_overlays (from);