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

Add asserts for issue5684. Fork of 3.0.16.

parent 5b687efe
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -68,6 +68,7 @@ static void iTermMakeBackgroundColorRun(iTermBackgroundColorRun *run,
BOOL first = YES;
int j;
for (j = charRange.location; j < charRange.location + charRange.length; j++) {
assert(j < width);
int x = j;
if (theLine[j].code == DWC_RIGHT) {
x = j - 1;
Loading
Loading
Loading
Loading
@@ -171,6 +171,7 @@ enum {
}
 
- (void)drawOneRect:(NSRect)rect {
assert(rect.size.width > 0);
// The range of chars in the line that need to be drawn.
VT100GridCoordRange coordRange = [self drawableCoordRangeForRect:rect];
 
Loading
Loading
@@ -200,6 +201,9 @@ enum {
// element per line. That element (a PTYTextViewBackgroundRunArray) contains the line number,
// y origin, and an array of PTYTextViewBackgroundRunBox objects.
NSRange charRange = NSMakeRange(coordRange.start.x, coordRange.end.x - coordRange.start.x);
assert(charRange.location < _gridSize.width);
assert(charRange.location + charRange.length <= _gridSize.width);
double y = coordRange.start.y * _cellSize.height;
// An array of PTYTextViewBackgroundRunArray objects (one element per line).
NSMutableArray *backgroundRunArrays = [NSMutableArray array];
Loading
Loading
@@ -210,6 +214,10 @@ enum {
screen_char_t* theLine = [self.delegate drawingHelperLineAtIndex:line];
NSIndexSet *selectedIndexes =
[_selection selectedIndexesIncludingTabFillersInLine:line];
assert(_gridSize.width > 0);
assert(charRange.location < _gridSize.width);
assert(charRange.location + charRange.length <= _gridSize.width);
iTermBackgroundColorRunsInLine *runsInLine =
[iTermBackgroundColorRunsInLine backgroundRunsInLine:theLine
lineLength:_gridSize.width
Loading
Loading
@@ -1786,6 +1794,9 @@ enum {
}
 
- (NSRange)rangeOfColumnsFrom:(CGFloat)x ofWidth:(CGFloat)width {
assert(width > 0);
assert(_cellSize.width > 0);
assert(_gridSize.width > 0);
NSRange charRange;
charRange.location = MAX(0, (x - MARGIN) / _cellSize.width);
charRange.length = ceil((x + width - MARGIN) / _cellSize.width) - charRange.location;
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