From 5d2ed951076535f28ba68fbb9968dad911fffaa5 Mon Sep 17 00:00:00 2001 From: Neil Date: Wed, 17 Jul 2019 15:29:06 +1000 Subject: Backport: Bug [#2120]. Avoid candidate window obscuring text when near bottom of screen. Feature [feature-requests:#1300] part 1. Backport of changeset 7683:b99264d451e3. --- win32/ScintillaWin.cxx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'win32') diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx index ebfe89ad4..232d00442 100644 --- a/win32/ScintillaWin.cxx +++ b/win32/ScintillaWin.cxx @@ -943,11 +943,17 @@ void ScintillaWin::SetCandidateWindowPos() { IMContext imc(MainHWND()); if (imc.hIMC) { const Point pos = PointMainCaret(); - CANDIDATEFORM CandForm; + const PRectangle rcClient = GetTextRectangle(); + CANDIDATEFORM CandForm{}; CandForm.dwIndex = 0; - CandForm.dwStyle = CFS_CANDIDATEPOS; + CandForm.dwStyle = CFS_EXCLUDE; CandForm.ptCurrentPos.x = static_cast(pos.x); CandForm.ptCurrentPos.y = static_cast(pos.y + vs.lineHeight); + // Exclude the area of the whole caret line + CandForm.rcArea.top = static_cast(pos.y); + CandForm.rcArea.bottom = static_cast(pos.y + vs.lineHeight); + CandForm.rcArea.left = static_cast(rcClient.left); + CandForm.rcArea.right = static_cast(rcClient.right); ::ImmSetCandidateWindow(imc.hIMC, &CandForm); } } -- cgit v1.2.3