diff options
author | Neil <nyamatongwe@gmail.com> | 2018-06-02 08:59:06 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2018-06-02 08:59:06 +1000 |
commit | 6154e349da3fb848b05d99aeb1aca3d2d3915fca (patch) | |
tree | eb7708bb6d59fcb9729f15fa9747d392d819460e | |
parent | 7d489f57b1b54fe5e895798bc29e7050e992b71c (diff) | |
download | scintilla-mirror-6154e349da3fb848b05d99aeb1aca3d2d3915fca.tar.gz |
Make virtual space selections visible in bidirectional mode.
-rw-r--r-- | src/EditView.cxx | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/EditView.cxx b/src/EditView.cxx index 7e2694366..46eda5d3b 100644 --- a/src/EditView.cxx +++ b/src/EditView.cxx @@ -1672,6 +1672,7 @@ static void DrawTranslucentSelection(Surface *surface, const EditModel &model, c if (alpha != SC_ALPHA_NOALPHA) { const SelectionSegment portion = model.sel.Range(r).Intersect(virtualSpaceRange); if (!portion.Empty()) { + const XYPOSITION spaceWidth = vsDraw.styles[ll->EndLineStyle()].spaceWidth; if (model.BidirectionalEnabled()) { const int selectionStart = static_cast<int>(portion.start.Position() - posLineStart - lineRange.start); const int selectionEnd = static_cast<int>(portion.end.Position() - posLineStart - lineRange.start); @@ -1688,8 +1689,16 @@ static void DrawTranslucentSelection(Surface *surface, const EditModel &model, c const PRectangle rcSelection(rcLeft, rcLine.top, rcRight, rcLine.bottom); SimpleAlphaRectangle(surface, rcSelection, background, alpha); } + + if (portion.end.VirtualSpace()) { + const XYPOSITION xStartVirtual = ll->positions[lineRange.end] - + static_cast<XYPOSITION>(subLineStart) + xStart; + PRectangle rcSegment = rcLine; + rcSegment.left = xStartVirtual + portion.start.VirtualSpace() * spaceWidth; + rcSegment.right = xStartVirtual + portion.end.VirtualSpace() * spaceWidth; + SimpleAlphaRectangle(surface, rcSegment, background, alpha); + } } else { - const XYPOSITION spaceWidth = vsDraw.styles[ll->EndLineStyle()].spaceWidth; PRectangle rcSegment = rcLine; rcSegment.left = xStart + ll->positions[portion.start.Position() - posLineStart] - static_cast<XYPOSITION>(subLineStart) + portion.start.VirtualSpace() * spaceWidth; |