aboutsummaryrefslogtreecommitdiffstats
path: root/Source/CustomQuery.m
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2010-01-29 16:10:14 +0000
committerBibiko <bibiko@eva.mpg.de>2010-01-29 16:10:14 +0000
commitc316e723764eba6141456acb8a61a4cdfcf68e62 (patch)
treead2ca16c03e708d7dbedafa0b9cc1b35a3d17852 /Source/CustomQuery.m
parent7591371032bbb7956b71ee5d70c0c3139872e3dd (diff)
downloadsequelpro-c316e723764eba6141456acb8a61a4cdfcf68e62.tar.gz
sequelpro-c316e723764eba6141456acb8a61a4cdfcf68e62.tar.bz2
sequelpro-c316e723764eba6141456acb8a61a4cdfcf68e62.zip
• text macro logic
- improved highlighting of multi-line snippets (many thanks to jabakobob for this patch!) - some tiny cosmetics • error message highlighting in Custom Query Editor - removed near message length checking to be larger than 2, not necessary
Diffstat (limited to 'Source/CustomQuery.m')
-rw-r--r--Source/CustomQuery.m7
1 files changed, 4 insertions, 3 deletions
diff --git a/Source/CustomQuery.m b/Source/CustomQuery.m
index 9600d929..4c850bde 100644
--- a/Source/CustomQuery.m
+++ b/Source/CustomQuery.m
@@ -702,11 +702,10 @@
// Get the line number
NSUInteger errorAtLine = [[errors substringWithRange:errorLineNumberRange] integerValue];
NSUInteger lineOffset = [textView getLineNumberForCharacterIndex:[self queryTextRangeForQuery:firstErrorOccuredInQuery startPosition:queryStartPosition].location] - 1;
- [textView selectLineNumber:errorAtLine+lineOffset ignoreLeadingNewLines:YES];
// Check for near message
NSRange errorNearMessageRange = [errors rangeOfRegex:@"[( ]'(.+)'[ -]" options:(RKLMultiline|RKLDotAll) inRange:NSMakeRange(0, [errors length]) capture:1L error:nil];
- if(errorNearMessageRange.length > 2) // if a "near message" was found
+ if(errorNearMessageRange.length) // if a "near message" was found
{
NSUInteger bufferLength = [[textView string] length];
@@ -728,6 +727,8 @@
[textView setSelectedRange:textNearMessageRange];
[textView scrollRangeToVisible:textNearMessageRange];
}
+ } else {
+ [textView selectLineNumber:errorAtLine+lineOffset ignoreLeadingNewLines:YES];
}
} else { // Select first erroneous query entirely
@@ -746,7 +747,7 @@
[textView scrollRangeToVisible:queryRange];
}
}
-
+
} else if ( [errors length] && queryIsTableSorter ) {
[errorText setStringValue:NSLocalizedString(@"Couldn't sort column.", @"text shown if an error occured while sorting the result table")];
NSBeep();