Merge "Handle emojis with emoji-modifier and zwj properly on backspace"
This commit is contained in:
@@ -229,6 +229,8 @@ public abstract class BaseKeyListener extends MetaKeyKeyListener
|
||||
break;
|
||||
} else if (Emoji.isEmojiModifierBase(codePoint)) {
|
||||
deleteCharCount += Character.charCount(codePoint);
|
||||
state = STATE_BEFORE_EMOJI;
|
||||
break;
|
||||
}
|
||||
state = STATE_FINISHED;
|
||||
break;
|
||||
|
||||
@@ -193,11 +193,15 @@ public class BackspaceTest {
|
||||
backspace(state, 0);
|
||||
state.assertEquals("|");
|
||||
|
||||
// Emoji modifier can be appended to the first emoji.
|
||||
// Emoji modifier can be appended to each emoji.
|
||||
state.setByString("U+1F469 U+1F3FB U+200D U+1F4BC |");
|
||||
backspace(state, 0);
|
||||
state.assertEquals("|");
|
||||
|
||||
state.setByString("U+1F468 U+1F3FF U+200D U+2764 U+FE0F U+200D U+1F468 U+1F3FB |");
|
||||
backspace(state, 0);
|
||||
state.assertEquals("|");
|
||||
|
||||
// End with ZERO WIDTH JOINER
|
||||
state.setByString("U+1F441 U+200D |");
|
||||
backspace(state, 0);
|
||||
|
||||
Reference in New Issue
Block a user