From a98dc4fbced60a016511e407ebc77eb37ec3b8cf Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Wed, 26 Aug 2009 10:50:03 +0000 Subject: Caret is now visible even when it is at the start of the line and is not before the first character which could occur if there was a zero-width character at the start of the line. --- src/Editor.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') 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(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; -- cgit v1.2.3