aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2009-07-08 00:14:41 +0000
committernyamatongwe <devnull@localhost>2009-07-08 00:14:41 +0000
commite8a546dc66099534a72bf536383628ce18626a03 (patch)
tree40fb06f7739fb74955b5185bc9b7f4e58021b4c2 /src
parent46c3c53a3c290f8757931a9f30bbf5f9577dd685 (diff)
downloadscintilla-mirror-e8a546dc66099534a72bf536383628ce18626a03.tar.gz
Moved calculation of rectangular range from occurring after every style
change to after the styles have been valided. Previously was very slow when setting monospaced font mode. Made more code sensitive to virtual spaces to draw caret and selection more accurately.
Diffstat (limited to 'src')
-rw-r--r--src/Editor.cxx4
-rw-r--r--src/Selection.cxx3
2 files changed, 4 insertions, 3 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx
index eeee752a8..f1210e8c9 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -225,7 +225,6 @@ void Editor::InvalidateStyleData() {
palette.Release();
llc.Invalidate(LineLayout::llInvalid);
posCache.Clear();
- SetRectangularRange();
}
void Editor::InvalidateStyleRedraw() {
@@ -258,6 +257,7 @@ void Editor::RefreshStyleData() {
wrapAddIndent = vs.aveCharWidth; // must indent to show start visual
}
SetScrollBars();
+ SetRectangularRange();
}
}
@@ -3077,7 +3077,7 @@ void Editor::DrawCarets(Surface *surface, ViewStyle &vsDraw, int lineDoc, int xS
if (widthOverstrikeCaret < 3) // Make sure its visible
widthOverstrikeCaret = 3;
- if (offset > ll->LineStart(subLine))
+ if (posCaret > SelectionPosition(ll->LineStart(subLine) + rangeLine.start))
caretWidthOffset = 1; // Move back so overlaps both character cells.
if (posDrag.IsValid()) {
/* Dragging text, use a line caret */
diff --git a/src/Selection.cxx b/src/Selection.cxx
index 715319602..d4d4d8fe8 100644
--- a/src/Selection.cxx
+++ b/src/Selection.cxx
@@ -113,6 +113,7 @@ bool SelectionRange::ContainsCharacter(int posCharacter) const {
bool SelectionRange::Intersect(int start, int end, SelectionPosition &selStart, SelectionPosition &selEnd) const {
SelectionPosition spEnd(end, 100000); // Large amount of virtual space
+ SelectionPosition spStart(start);
SelectionPosition first;
SelectionPosition last;
if (anchor > caret) {
@@ -122,7 +123,7 @@ bool SelectionRange::Intersect(int start, int end, SelectionPosition &selStart,
first = anchor;
last = caret;
}
- if ((first < spEnd) && (last.Position() > start)) {
+ if ((first < spEnd) && (last > spStart)) {
if (start > first.Position())
selStart = SelectionPosition(start);
else