From 6aea75304eb832c898cbe6f35f99ff1512920b45 Mon Sep 17 00:00:00 2001 From: Neil Date: Fri, 27 Dec 2013 13:06:56 +1100 Subject: Ensure caret is visible after scroll. --- src/Editor.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/Editor.cxx b/src/Editor.cxx index da6b2eab3..7bc142ee3 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -1488,9 +1488,9 @@ Editor::XYScrollPosition Editor::XYScrollToMakeVisible(const SelectionRange rang } // In case of a jump (find result) largely out of display, adjust the offset to display the caret if (pt.x + xOffset < rcClient.left + newXY.xOffset) { - newXY.xOffset = pt.x + xOffset - rcClient.left; + newXY.xOffset = pt.x + xOffset - rcClient.left - 2; } else if (pt.x + xOffset >= rcClient.right + newXY.xOffset) { - newXY.xOffset = pt.x + xOffset - rcClient.right + 1; + newXY.xOffset = pt.x + xOffset - rcClient.right + 2; if (vs.caretStyle == CARETSTYLE_BLOCK) { // Ensure we can see a good portion of the block caret newXY.xOffset += static_cast(vs.aveCharWidth); -- cgit v1.2.3