[PR #4140] [MERGED] Fix IME/CoreTextEditContext not being reset properly #25650

Open
opened 2026-01-31 09:10:53 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/4140
Author: @lhecker
Created: 1/7/2020
Status: Merged
Merged: 1/8/2020
Merged by: @undefined

Base: masterHead: fix-ime


📝 Commits (1)

  • dfa7b4a Fix IME/CoreTextEditContext not being reset properly

📊 Changes

1 file changed (+4 additions, -11 deletions)

View changed files

📝 src/cascadia/TerminalControl/TSFInputControl.cpp (+4 -11)

📄 Description

The first argument to NotifyTextChanged incorrectly was [0,0]
instead of the length of the text to be removed from the
CoreTextEditContext.

Best source of documentation for NotifyTextChanged:
https://docs.microsoft.com/en-us/windows/uwp/design/input/custom-text-input#overriding-text-updates

FYI @DHowett-MSFT (just in case): C++/WinRT uses winrt::param::hstring
for string parameters which intelligently borrows strings. As such you
can simply pass a std::wstring to most WinRT methods without the need
of having to allocate an intermediate hstring. 🙂

Validation Steps Performed

I followed the reproduction instructions of #3706 and #3745 and ensured
the issue doesn't happen anymore.

Closes #3645
Closes #3706
Closes #3745


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/4140 **Author:** [@lhecker](https://github.com/lhecker) **Created:** 1/7/2020 **Status:** ✅ Merged **Merged:** 1/8/2020 **Merged by:** [@undefined](undefined) **Base:** `master` ← **Head:** `fix-ime` --- ### 📝 Commits (1) - [`dfa7b4a`](https://github.com/microsoft/terminal/commit/dfa7b4a16c7a8f6a2d4b6337dcf524d3c6f017ba) Fix IME/CoreTextEditContext not being reset properly ### 📊 Changes **1 file changed** (+4 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/TerminalControl/TSFInputControl.cpp` (+4 -11) </details> ### 📄 Description The first argument to `NotifyTextChanged` incorrectly was `[0,0]` instead of the length of the text to be removed from the `CoreTextEditContext`. Best source of documentation for `NotifyTextChanged`: https://docs.microsoft.com/en-us/windows/uwp/design/input/custom-text-input#overriding-text-updates FYI @DHowett-MSFT (just in case): C++/WinRT uses `winrt::param::hstring` for string parameters which intelligently borrows strings. As such you can simply pass a `std::wstring` to most WinRT methods without the need of having to allocate an intermediate `hstring`. 🙂 ## Validation Steps Performed I followed the reproduction instructions of #3706 and #3745 and ensured the issue doesn't happen anymore. Closes #3645 Closes #3706 Closes #3745 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:10:53 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#25650