# Fix Windows IME composition string being displayed incorrectly \(\#46545\) · gitcafe/zed

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

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

Visibility: public

Requested revision: af6385a29355dd2859e9751ebd76e418dd6a249a

Requested commit: af6385a29355dd2859e9751ebd76e418dd6a249a

Commit: af6385a29355dd2859e9751ebd76e418dd6a249a

Tree: 10053b170d91cd17c0c8865fb951513ea02c6b47

Author: John Tur

Committer: GitHub

## Message

```
Fix Windows IME composition string being displayed incorrectly (#46545)

Previously, a new composition string was processed before a new
composition result. Thus, in the case that a keystroke creates a new
composition result and composition string, the processing of the new
result would overwrite the new string, even though they should both be
displayed. Processing them in the reverse order fixes this issue.
 
Fixes #42201

Additionally: while fixing this issue, I discovered that the Japanese
IME sometimes moves the cursor far away from the inserted text. WPF
works around this issue by only respecting the IME's requested cursor
position if it's adjacent to uncommitted text. So, we copy this
workaround.

Release Notes:

- N/A
```

## Parents

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

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