From aefa36e90bb7d11881138ec6acd82f245f2c346d Mon Sep 17 00:00:00 2001 From: johnsonj Date: Fri, 16 May 2025 12:12:13 +1000 Subject: Feature [feature-requests:#1488]. Update IME cursor position inside retrieve surrounding to better position candidate window. --- doc/ScintillaHistory.html | 4 ++++ gtk/ScintillaGTK.cxx | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html index f82671db4..4d3c73774 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -624,6 +624,10 @@ On GTK, fix IME problem when tentative composition interfered with delete surrounding. Feature #1476. +
  • + On GTK, update IME cursor position inside retrieve surrounding to better position candidate window. + Feature #1488. +
  • Release 5.5.6 diff --git a/gtk/ScintillaGTK.cxx b/gtk/ScintillaGTK.cxx index 4c71d4a7e..3f8ce2d9e 100755 --- a/gtk/ScintillaGTK.cxx +++ b/gtk/ScintillaGTK.cxx @@ -2604,6 +2604,13 @@ bool ScintillaGTK::RetrieveSurroundingThis(GtkIMContext *context) { std::string utf8Text = UTF8FromEncoded(RangeText(startByte, endByte)); gint cursorIndex = UTF8FromEncoded(RangeText(startByte, pos)).length(); + if (pdoc->TentativeActive()) { + // Prepare one line feed with no preedit under PreeditChangedInlineThis(); + } else { + // reconvert key triggers CandidateBox to show up + // when quick phrase input on fcitx (or maybe accented input on mac) + SetCandidateWindowPos(); + } gtk_im_context_set_surrounding(context, &utf8Text[0], utf8Text.length(), cursorIndex); return true; -- cgit v1.2.3