Commit 0328707e authored by Matthias Clasen's avatar Matthias Clasen

Fix backspace-deletes-character for Emoji

We want to delete the entire cluster if it is an Emoji.
To do so, look at prev_GB_type to find Emoji.

This fixes backspacing for sequences like
"man health worker" or "family: man, woman, boy, girl".
parent 287d6ecd
......@@ -861,15 +861,23 @@ pango_default_break (const gchar *text,
else
is_grapheme_boundary = TRUE; /* Rule GB999 */
prev_GB_type = GB_type;
attrs[i].is_cursor_position = is_grapheme_boundary;
/* If this is a grapheme boundary, we have to decide if backspace
* deletes a character or the whole grapheme cluster */
if (is_grapheme_boundary)
attrs[i].backspace_deletes_character = BACKSPACE_DELETES_CHARACTER (base_character);
{
if (prev_GB_type == GB_E_Base ||
prev_GB_type == GB_E_Base_GAZ ||
prev_GB_type == GB_Glue_After_Zwj ||
prev_GB_type == GB_Extend)
attrs[i].backspace_deletes_character = FALSE;
else
attrs[i].backspace_deletes_character = BACKSPACE_DELETES_CHARACTER (base_character);
}
else
attrs[i].backspace_deletes_character = FALSE;
prev_GB_type = GB_type;
}
/* ---- UAX#29 Word Boundaries ---- */
......
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