aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Editor.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx
index 2d438e8db..b1065b77e 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -3097,7 +3097,7 @@ void Editor::DrawCarets(Surface *surface, ViewStyle &vsDraw, int lineDoc, int xS
const int spaceWidth = static_cast<int>(vsDraw.styles[ll->EndLineStyle()].spaceWidth);
const int virtualOffset = posCaret.VirtualSpace() * spaceWidth;
if (ll->InLine(offset, subLine) && offset <= ll->numCharsBeforeEOL) {
- int xposCaret = ll->positions[offset] + virtualOffset - ll->positions[ll->LineStart(subLine)] + xStart;
+ int xposCaret = ll->positions[offset] + virtualOffset - ll->positions[ll->LineStart(subLine)];
if (ll->wrapIndent != 0) {
int lineStart = ll->LineStart(subLine);
if (lineStart != 0) // Wrapped
@@ -3124,8 +3124,9 @@ void Editor::DrawCarets(Surface *surface, ViewStyle &vsDraw, int lineDoc, int xS
if (widthOverstrikeCaret < 3) // Make sure its visible
widthOverstrikeCaret = 3;
- if (posCaret > SelectionPosition(ll->LineStart(subLine) + posLineStart))
+ if (xposCaret > 0)
caretWidthOffset = 1; // Move back so overlaps both character cells.
+ xposCaret += xStart;
if (posDrag.IsValid()) {
/* Dragging text, use a line caret */
rcCaret.left = xposCaret - caretWidthOffset;