# gpui: Fix a bug with Japanese romaji typing in input example \(\#28507\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/6e28400e176a94c54bbea40f2502fe3c331c1be2)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 6e28400e176a94c54bbea40f2502fe3c331c1be2

Requested commit: 6e28400e176a94c54bbea40f2502fe3c331c1be2

Commit: 6e28400e176a94c54bbea40f2502fe3c331c1be2

Tree: d39d756b7ddc7b66c5ba12c0e9d058e8aed8fb87

Author: Pavel

Committer: GitHub

## Message

```
gpui: Fix a bug with Japanese romaji typing in input example (#28507)

Steps to reproduce:
* On macOS, run `input` example
* type `aaa|bbb` place caret on the place marked with |
* switch to `japanese romaji`
* press `ko`
* press left arrow

<img width="412" alt="image"
src="https://github.com/user-attachments/assets/d3c02e9b-98f9-420e-a3b7-681ba90829cd"
/>

You will get `aaa` duplicated with every arrow press.

According to [reference
implementation](https://developer.apple.com/library/archive/samplecode/TextInputView/Listings/FadingTextView_m.html#//apple_ref/doc/uid/DTS40008840-FadingTextView_m-DontLinkElementID_6)
we need to unmark text when we get empty line in `setMarkedText `
```

## Parents

- [78545a93eac0116c2cd8bc639ae2a83da4dab90d](https://git.cafe/gitcafe/zed/commit/78545a93eac0116c2cd8bc639ae2a83da4dab90d?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/6e28400e176a94c54bbea40f2502fe3c331c1be2?format=markdown)
