Clip UTF-16 offsets in text for range (#20968)
When launching the Pinyin keyboard, macOS will sometimes try to peek one character back in the string. This caused a panic if the preceding character was an emoji. The docs say "don't assume the range is valid", so now we don't. Release Notes: - (macOS) Fixed a panic when using the Pinyin keyboard with emojis
This commit is contained in:
parent
7285cdb955
commit
ebaa270baf
6 changed files with 70 additions and 16 deletions
|
@ -1001,6 +1001,7 @@ impl InputHandler for TerminalInputHandler {
|
|||
fn text_for_range(
|
||||
&mut self,
|
||||
_: std::ops::Range<usize>,
|
||||
_: &mut Option<std::ops::Range<usize>>,
|
||||
_: &mut WindowContext,
|
||||
) -> Option<String> {
|
||||
None
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue