From ba0b0b4e7c85b65d817417a83400acc8558fb76d Mon Sep 17 00:00:00 2001 From: martin Date: Mon, 23 Mar 2015 12:49:17 +0000 Subject: [PATCH] SynEdit: win, IME Handler: Fixed (added) overwrite selection. Issue #0027712 git-svn-id: trunk@48460 - --- components/synedit/lazsynimm.pas | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/synedit/lazsynimm.pas b/components/synedit/lazsynimm.pas index c555eb8371..5206381c2d 100644 --- a/components/synedit/lazsynimm.pas +++ b/components/synedit/lazsynimm.pas @@ -313,9 +313,12 @@ begin GetMem(p, ImeCount + 2); try TCustomSynEdit(FriendEdit).BeginUpdate; + if SelectionObj.SelAvail and (not SelectionObj.Persistent) and (eoOverwriteBlock in TSynEdit(FriendEdit).Options2) then + SelectionObj.SelText := ''; ImmGetCompositionStringW(imc, GCS_RESULTSTR, p, ImeCount + 2); p[ImeCount] := #0; p[ImeCount+1] := #0; + FImeBlockSelection.StartLineBytePos := CaretObj.LineBytePos; FImeBlockSelection.SelText := UTF16ToUTF8(PWCHAR(p)); FImeBlockSelection.StartLineBytePos := FImeBlockSelection.EndLineBytePos; CaretObj.LineBytePos := FImeBlockSelection.StartLineBytePos; @@ -339,9 +342,6 @@ var imc: HIMC; begin //debugln(['TCustomSynEdit.WMImeStartComposition ']); - if SelectionObj.SelAvail and (not SelectionObj.Persistent) and (eoOverwriteBlock in TSynEdit(FriendEdit).Options2) then - SelectionObj.SelText := ''; - imc := ImmGetContext(FriendEdit.Handle); if (imc <> 0) then begin UpdateImeWinFont(imc);