aboutsummaryrefslogtreecommitdiffstats
path: root/Source/CMTextView.m
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2010-01-28 17:04:04 +0000
committerBibiko <bibiko@eva.mpg.de>2010-01-28 17:04:04 +0000
commit862a431ebf1571f09890f43702e50fdc43b13415 (patch)
treee5784b265d1a92e0db4786b62bfa34e6b3d55675 /Source/CMTextView.m
parent70558850380b1ea9bb8e7410bc3e77a7cff64263 (diff)
downloadsequelpro-862a431ebf1571f09890f43702e50fdc43b13415.tar.gz
sequelpro-862a431ebf1571f09890f43702e50fdc43b13415.tar.bz2
sequelpro-862a431ebf1571f09890f43702e50fdc43b13415.zip
• for [CMTextView selectLineNumber:…] added safety-check for lineNumber < 1
• error message highlighting in CustomQuery - check for error ID 1064 before trying to select the erroneous line given as '… at line x' (this solves the issue that other error messages could end by a number) - improved regexp to get rid of localized error messages for parsing the erroneous line number (thanks to Jakob) - look the last number in a string - improved regexp to parse for the 'near message' for localized error messages
Diffstat (limited to 'Source/CMTextView.m')
-rw-r--r--Source/CMTextView.m3
1 files changed, 2 insertions, 1 deletions
diff --git a/Source/CMTextView.m b/Source/CMTextView.m
index 1d75eb93..6bd6f315 100644
--- a/Source/CMTextView.m
+++ b/Source/CMTextView.m
@@ -760,9 +760,10 @@ NSInteger alphabeticSort(id string1, id string2, void *reverse)
lineNumber++;
}
}
-
+
// Safety-check the line number
if (lineNumber > [lineRanges count]) lineNumber = [lineRanges count];
+ if (lineNumber < 1) lineNumber = 1;
// Grab the range to select
selRange = NSRangeFromString([lineRanges objectAtIndex:lineNumber-1]);