From 61066182da826a8a1bd00673851931a8c200f637 Mon Sep 17 00:00:00 2001 From: johnsonj Date: Sun, 11 May 2025 18:20:38 +1000 Subject: Feature [feature-requests:#1476]. Fix IME delete surrounding when tentative composition active. --- doc/ScintillaHistory.html | 4 ++++ gtk/ScintillaGTK.cxx | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html index 36b1f56f7..49b96aa2c 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -612,6 +612,10 @@ scroll position not restored in non-wrap mode. Bug #2416. +
  • + On GTK, fix IME problem when tentative composition interfered with delete surrounding. + Feature #1476. +
  • Release 5.5.6 diff --git a/gtk/ScintillaGTK.cxx b/gtk/ScintillaGTK.cxx index 2985aab54..4c71d4a7e 100755 --- a/gtk/ScintillaGTK.cxx +++ b/gtk/ScintillaGTK.cxx @@ -2619,6 +2619,10 @@ gboolean ScintillaGTK::RetrieveSurrounding(GtkIMContext *context, ScintillaGTK * bool ScintillaGTK::DeleteSurroundingThis(GtkIMContext *, gint characterOffset, gint characterCount) { try { + if (pdoc->TentativeActive()) { + // First remove composition text so that correct surrounding text is deleted. + pdoc->TentativeUndo(); + } const Sci::Position startByte = pdoc->GetRelativePosition(CurrentPosition(), characterOffset); if (startByte == INVALID_POSITION) return false; -- cgit v1.2.3