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

(handle_auto_composed_prop): Fix previous change.

parent f1920351
...@@ -4553,7 +4553,7 @@ handle_auto_composed_prop (it) ...@@ -4553,7 +4553,7 @@ handle_auto_composed_prop (it)
   
if (FUNCTIONP (Vauto_composition_function)) if (FUNCTIONP (Vauto_composition_function))
{ {
Lisp_Object val; Lisp_Object val = Qnil;
EMACS_INT pos, pos_byte, this_pos, start, end; EMACS_INT pos, pos_byte, this_pos, start, end;
int c; int c;
   
...@@ -4596,7 +4596,8 @@ handle_auto_composed_prop (it) ...@@ -4596,7 +4596,8 @@ handle_auto_composed_prop (it)
if (! EQ (font_object, if (! EQ (font_object,
font_at (c, pos, FACE_FROM_ID (it->f, it->face_id), font_at (c, pos, FACE_FROM_ID (it->f, it->face_id),
it->w, it->string))) it->w, it->string)))
/* We must re-compute the composition. */ /* We must re-compute the composition for the
different font. */
val = Qnil; val = Qnil;
} }
#endif #endif
...@@ -4618,22 +4619,16 @@ handle_auto_composed_prop (it) ...@@ -4618,22 +4619,16 @@ handle_auto_composed_prop (it)
auto-composed region. There's a possiblity that auto-composed region. There's a possiblity that
the last characters in the region may be newly the last characters in the region may be newly
composed. */ composed. */
int charpos = end - 1, bytepos, c; if (pos < end - 1)
if (STRINGP (it->string))
{
bytepos = string_char_to_byte (it->string, charpos);
c = SDATA (it->string)[bytepos];
}
else
{ {
bytepos = CHAR_TO_BYTE (charpos); if (get_property_and_range (end - 1, Qcomposition,
c = FETCH_BYTE (bytepos); &cmp_prop, &cmp_start,
&cmp_end, it->string))
pos = cmp_start;
else
pos = end - 1;
} }
if (c != '\n') val = Qnil;
/* If the last character is not newline, it may be
composed with the following characters. */
val = Qnil, pos = charpos + 1;
} }
} }
} }
......
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