From 78ac9f3ecf3ee474ea2e6c45ae32450a5b6d2ac4 Mon Sep 17 00:00:00 2001 From: Neil Date: Sun, 3 Nov 2019 08:00:52 +1100 Subject: Bug [#2130]. Setting rectangular selection made faster by reusing surface. --- doc/ScintillaHistory.html | 4 ++++ src/Editor.cxx | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html index 2c49c8c9f..d7312f008 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -583,6 +583,10 @@ Feature #1304.
  • + Setting rectangular selection made faster. + Bug #2130. +
  • +
  • SciTE reassigns *.s extension to the GNU Assembler language from the S+ statistical language.
  • diff --git a/src/Editor.cxx b/src/Editor.cxx index dbcafeb89..d2b447d86 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -594,8 +594,11 @@ void Editor::SetRectangularRange() { const Sci::Line lineCaret = pdoc->SciLineFromPosition(sel.Rectangular().caret.Position()); const int increment = (lineCaret > lineAnchorRect) ? 1 : -1; + AutoSurface surface(this); for (Sci::Line line=lineAnchorRect; line != lineCaret+increment; line += increment) { - SelectionRange range(SPositionFromLineX(line, xCaret), SPositionFromLineX(line, xAnchor)); + SelectionRange range( + view.SPositionFromLineX(surface, *this, line, xCaret, vs), + view.SPositionFromLineX(surface, *this, line, xAnchor, vs)); if ((virtualSpaceOptions & SCVS_RECTANGULARSELECTION) == 0) range.ClearVirtualSpace(); if (line == lineAnchorRect) -- cgit v1.2.3