From ed3a51fa704071682545f084e3ab52d86200519c Mon Sep 17 00:00:00 2001 From: John Ehresman Date: Sun, 22 Jan 2017 19:45:45 +1100 Subject: Display block caret over the character at the end of a selection to be similar to other editors. --- doc/ScintillaHistory.html | 4 ++++ src/EditView.cxx | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html index 0972070d6..fd62d8376 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -525,6 +525,10 @@ Released 30 December 2016.
  • + Display block caret over the character at the end of a selection to be similar + to other editors. +
  • +
  • The Diff lexer recognizes deleted lines that start with "--- ".
  • diff --git a/src/EditView.cxx b/src/EditView.cxx index a35a46b54..48991e480 100644 --- a/src/EditView.cxx +++ b/src/EditView.cxx @@ -1288,7 +1288,13 @@ void EditView::DrawCarets(Surface *surface, const EditModel &model, const ViewSt // For each selection draw for (size_t r = 0; (r model.sel.Range(r).anchor) { + if (posCaret.VirtualSpace() > 0) + posCaret.SetVirtualSpace(posCaret.VirtualSpace() - 1); + else + posCaret.SetPosition(model.pdoc->MovePositionOutsideChar(posCaret.Position()-1, -1)); + } const int offset = posCaret.Position() - posLineStart; const XYPOSITION spaceWidth = vsDraw.styles[ll->EndLineStyle()].spaceWidth; const XYPOSITION virtualOffset = posCaret.VirtualSpace() * spaceWidth; -- cgit v1.2.3