From 26fc47b6fc2445b1d9b4a20eb3ccc79cf2fca315 Mon Sep 17 00:00:00 2001 From: johnsonj Date: Sun, 5 Mar 2017 16:28:31 +1100 Subject: For IMEs, do not clear selected text when there is no composition text to show. --- doc/ScintillaHistory.html | 3 +++ gtk/ScintillaGTK.cxx | 5 ++++- qt/ScintillaEditBase/ScintillaEditBase.cpp | 5 ++++- win32/ScintillaWin.cxx | 5 ++++- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html index ab03e7f3e..764d1eeb3 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -527,6 +527,9 @@ Released 19 February 2017.
  • + For IMEs, do not clear selected text when there is no composition text to show. +
  • +
  • Fix to stream selection mode when moving caret up or down. Bug #1905.
  • diff --git a/gtk/ScintillaGTK.cxx b/gtk/ScintillaGTK.cxx index 1da8ebd4e..a9335e14e 100644 --- a/gtk/ScintillaGTK.cxx +++ b/gtk/ScintillaGTK.cxx @@ -2323,12 +2323,13 @@ void ScintillaGTK::PreeditChangedInlineThis() { view.imeCaretBlockOverride = false; // If backspace. + bool initialCompose = false; if (pdoc->TentativeActive()) { pdoc->TentativeUndo(); } else { // No tentative undo means start of this composition so // fill in any virtual spaces. - ClearBeforeTentativeStart(); + initialCompose = true; } PreEditString preeditStr(im_context); @@ -2345,6 +2346,8 @@ void ScintillaGTK::PreeditChangedInlineThis() { return; } + if (initialCompose) + ClearBeforeTentativeStart(); pdoc->TentativeStart(); // TentativeActive() from now on std::vector indicator = MapImeIndicators(preeditStr.attrs, preeditStr.str); diff --git a/qt/ScintillaEditBase/ScintillaEditBase.cpp b/qt/ScintillaEditBase/ScintillaEditBase.cpp index eb51ef1d1..9059e6344 100644 --- a/qt/ScintillaEditBase/ScintillaEditBase.cpp +++ b/qt/ScintillaEditBase/ScintillaEditBase.cpp @@ -525,12 +525,13 @@ void ScintillaEditBase::inputMethodEvent(QInputMethodEvent *event) return; } + bool initialCompose = false; if (sqt->pdoc->TentativeActive()) { sqt->pdoc->TentativeUndo(); } else { // No tentative undo means start of this composition so // Fill in any virtual spaces. - sqt->ClearBeforeTentativeStart(); + initialCompose = true; } sqt->view.imeCaretBlockOverride = false; @@ -557,6 +558,8 @@ void ScintillaEditBase::inputMethodEvent(QInputMethodEvent *event) return; } + if (initialCompose) + sqt->ClearBeforeTentativeStart(); sqt->pdoc->TentativeStart(); // TentativeActive() from now on. std::vector imeIndicator = MapImeIndicators(event); diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx index 265789330..ae20ac2e9 100644 --- a/win32/ScintillaWin.cxx +++ b/win32/ScintillaWin.cxx @@ -1061,12 +1061,13 @@ sptr_t ScintillaWin::HandleCompositionInline(uptr_t, sptr_t lParam) { return 0; } + bool initialCompose = false; if (pdoc->TentativeActive()) { pdoc->TentativeUndo(); } else { // No tentative undo means start of this composition so // fill in any virtual spaces. - ClearBeforeTentativeStart(); + initialCompose = true; } view.imeCaretBlockOverride = false; @@ -1078,6 +1079,8 @@ sptr_t ScintillaWin::HandleCompositionInline(uptr_t, sptr_t lParam) { return 0; } + if (initialCompose) + ClearBeforeTentativeStart(); pdoc->TentativeStart(); // TentativeActive from now on. std::vector imeIndicator = MapImeIndicators(imc.GetImeAttributes()); -- cgit v1.2.3