From 99b10e08e875d34e73b43743bda747bc17e76c9b Mon Sep 17 00:00:00 2001 From: Neil Date: Wed, 9 Jul 2014 16:37:39 +1000 Subject: Ensure correct width used for overstrike caret for multi-byte character on GTK+ where the width is spread over the bytes in the positions array. --- src/EditView.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/EditView.cxx b/src/EditView.cxx index 26ede6cd9..68a2c6ded 100644 --- a/src/EditView.cxx +++ b/src/EditView.cxx @@ -974,7 +974,8 @@ void EditView::DrawCarets(Surface *surface, const ViewStyle &vsDraw, int lineDoc caretAtEOL = true; widthOverstrikeCaret = vsDraw.aveCharWidth; } else { - widthOverstrikeCaret = ll->positions[offset + 1] - ll->positions[offset]; + const int widthChar = model.pdoc->LenChar(posCaret.Position()); + widthOverstrikeCaret = ll->positions[offset + widthChar] - ll->positions[offset]; } if (widthOverstrikeCaret < 3) // Make sure its visible widthOverstrikeCaret = 3; -- cgit v1.2.3