Skip to content

Commit 614f683

Browse files
committed
Merge pull request #63 from hemnstill/master
Fix selection from the end of the line. Line ends with spaces.
2 parents bb20f68 + 976f772 commit 614f683

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

ICSharpCode.AvalonEdit/Rendering/BackgroundGeometryBuilder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ static IEnumerable<Rect> ProcessTextLines(TextView textView, VisualLine visualLi
258258
}
259259
}
260260
if (segmentEndVC >= visualLine.VisualLengthWithEndOfLineMarker) {
261-
double left = (segmentStartVC > visualLine.VisualLengthWithEndOfLineMarker ? visualLine.GetTextLineVisualXPosition(lastTextLine, segmentStartVC) : line.Width) - scrollOffset.X;
261+
double left = (segmentStartVC > visualLine.VisualLengthWithEndOfLineMarker ? visualLine.GetTextLineVisualXPosition(lastTextLine, segmentStartVC) : line.WidthIncludingTrailingWhitespace) - scrollOffset.X;
262262
double right = ((segmentEndVC == int.MaxValue || line != lastTextLine) ? Math.Max(((IScrollInfo)textView).ExtentWidth, ((IScrollInfo)textView).ViewportWidth) : visualLine.GetTextLineVisualXPosition(lastTextLine, segmentEndVC)) - scrollOffset.X;
263263
Rect extendSelection = new Rect(Math.Min(left, right), y, Math.Abs(right - left), line.Height);
264264
if (!lastRect.IsEmpty) {

0 commit comments

Comments
 (0)