From c4f2c5052c7275aa083021af7fe231aedb7480a9 Mon Sep 17 00:00:00 2001 From: Bjorn Winckler Date: Sat, 26 Jul 2008 20:06:52 +0200 Subject: [PATCH] Ensure valid scroll region when deleting/inserting rows --- src/MacVim/MMTextStorage.m | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/MacVim/MMTextStorage.m b/src/MacVim/MMTextStorage.m index 9a6e9b29..cb018e1d 100644 --- a/src/MacVim/MMTextStorage.m +++ b/src/MacVim/MMTextStorage.m @@ -387,7 +387,8 @@ static NSString *MMWideCharacterAttributeName = @"MMWideChar"; //NSLog(@"deleteLinesFromRow:%d lineCount:%d color:%@", row, count, color); [self lazyResize:NO]; - if (row < 0 || row+count > maxRows) + if (row < 0 || row+count > maxRows || bottom > maxRows || left < 0 + || right > maxColumns) return; int total = 1 + bottom - row; @@ -484,7 +485,8 @@ static NSString *MMWideCharacterAttributeName = @"MMWideChar"; //NSLog(@"insertLinesAtRow:%d lineCount:%d color:%@", row, count, color); [self lazyResize:NO]; - if (row < 0 || row+count > maxRows) + if (row < 0 || row+count > maxRows || bottom > maxRows || left < 0 + || right > maxColumns) return; int total = 1 + bottom - row; -- 2.11.4.GIT