Commit 4a7cf15f authored by Kenichi Handa's avatar Kenichi Handa
Browse files

(adjust_after_replace): Fix the code to recode undo

information for the case that `before combining' happens.  Remove
text properties which are added to the new text by
offset_intervals.
parent df2ddb2d
......@@ -1601,7 +1601,7 @@ adjust_after_replace (from, from_byte, prev_text, len, len_byte)
len, len_byte,
combined_before_bytes, combined_after_bytes);
if (STRINGP (prev_text))
record_delete (from, prev_text);
record_delete (from - !!combined_before_bytes, prev_text);
record_insert (from - !!combined_before_bytes,
len - combined_before_bytes + !!combined_before_bytes);
......@@ -1611,7 +1611,13 @@ adjust_after_replace (from, from_byte, prev_text, len, len_byte)
adjust_overlays_for_delete (from, nchars_del - len);
#ifdef USE_TEXT_PROPERTIES
if (BUF_INTERVALS (current_buffer) != 0)
offset_intervals (current_buffer, from, len - nchars_del);
{
offset_intervals (current_buffer, from, len - nchars_del);
if (len - nchars_del > 0)
Fset_text_properties (make_number (from),
make_number (from + len - nchars_del),
Qnil, Qnil);
}
#endif
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment