mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-07 02:15:34 +00:00
app: [macOS] don't discard IME session for consistent snippets
An IME session must be discarded when its text content no longer matches the underlying text component content. However, the check for matching was too pessimistic; the IME session would be discarded if the new snippet from the text component was not equal to the snippet reported to the IME. This change implements a refined check that only discards a session if the content of the overlap between the new and old snippets don't match. Fixes an IME issue reported by Zhang Zj. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+1
-1
@@ -534,7 +534,7 @@ func (w *window) SetCursor(cursor pointer.Cursor) {
|
||||
}
|
||||
|
||||
func (w *window) EditorStateChanged(old, new editorState) {
|
||||
if old.Selection.Range != new.Selection.Range || old.Snippet != new.Snippet {
|
||||
if old.Selection.Range != new.Selection.Range || !areSnippetsConsistent(old.Snippet, new.Snippet) {
|
||||
C.discardMarkedText(w.view)
|
||||
w.w.SetComposingRegion(key.Range{Start: -1, End: -1})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user