Skip to content
Snippets Groups Projects
Commit 9f92cf70 authored by George Nachman's avatar George Nachman
Browse files

Fix a bug where selection length was not calculated correctly. This affected...

Fix a bug where selection length was not calculated correctly. This affected various optimizations that disable features for long selections. If the column window was not set then a length of up to the grid width (but not greater) was returned.
parent 728390c9
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -338,10 +338,14 @@ NS_INLINE long long VT100GridWindowedRangeLength(VT100GridWindowedRange range, i
} else {
int left = range.columnWindow.location;
int right = left + range.columnWindow.length;
if (range.columnWindow.length == 0) {
left = 0;
right = gridWidth;
}
int numFullLines = MAX(0, (range.coordRange.end.y - range.coordRange.start.y - 1));
return ((right - VT100GridWindowedRangeStart(range).x) + // Chars on first line
(VT100GridWindowedRangeEnd(range).x - left) + // Chars on second line
range.columnWindow.length * numFullLines); // Chars between
(right - left) * numFullLines); // Chars between
}
}
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment