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

Deal more gracefully with 0-size windows as suspected in issue 6005

parent 8bc31051
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -645,8 +645,9 @@ int OffsetOfWrappedLine(screen_char_t* p, int n, int length, int width, BOOL may
return NULL;
}
 
- (int) getNumLinesWithWrapWidth: (int) width
{
- (int)getNumLinesWithWrapWidth:(int)width {
ITBetaAssert(width > 0, @"Bogus value of width: %d", width);
if (width == cached_numlines_width) {
return cached_numlines;
}
Loading
Loading
Loading
Loading
@@ -1490,6 +1490,14 @@ ITERM_WEAKLY_REFERENCEABLE
}
 
- (void)setSize:(VT100GridSize)size {
ITBetaAssert(size.width > 0, @"Nonpositive width %d", size.width);
ITBetaAssert(size.height > 0, @"Nonpositive height %d", size.height);
if (size.width <= 0) {
size.width = 1;
}
if (size.height <= 0) {
size.height = 1;
}
self.lastResize = [NSDate timeIntervalSinceReferenceDate];
DLog(@"Set session %@ to %@", self, VT100GridSizeDescription(size));
[_screen setSize:size];
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