aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2010-02-02 14:31:25 +0000
committerBibiko <bibiko@eva.mpg.de>2010-02-02 14:31:25 +0000
commit736c95f11116e0be3e516933506034fb6078be72 (patch)
tree846858d08b0c86e8c21ad13c1487db80f5773ea7
parent9084465bbcd453cb2f433917c23d2bf4da65db08 (diff)
downloadsequelpro-736c95f11116e0be3e516933506034fb6078be72.tar.gz
sequelpro-736c95f11116e0be3e516933506034fb6078be72.tar.bz2
sequelpro-736c95f11116e0be3e516933506034fb6078be72.zip
• CMTextView
- suppress current query/syntax highlighting for text buffer size > 20MB to allow at least editing and performing queries • Main Menu - set hidden new Export menu item to key ⇧⌘E and reset "Use selection for searching" to ⌘E since it's a standard Mac binding
-rw-r--r--Interfaces/English.lproj/MainMenu.xib14
-rw-r--r--Source/CMTextView.m5
2 files changed, 11 insertions, 8 deletions
diff --git a/Interfaces/English.lproj/MainMenu.xib b/Interfaces/English.lproj/MainMenu.xib
index 2d08a972..c46febf5 100644
--- a/Interfaces/English.lproj/MainMenu.xib
+++ b/Interfaces/English.lproj/MainMenu.xib
@@ -12,7 +12,7 @@
</object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
- <integer value="498"/>
+ <integer value="29"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -378,7 +378,7 @@
<bool key="NSIsDisabled">YES</bool>
<bool key="NSIsHidden">YES</bool>
<string key="NSTitle">Export…</string>
- <string key="NSKeyEquiv">e</string>
+ <string key="NSKeyEquiv">E</string>
<int key="NSKeyEquivModMask">1048576</int>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="625762401"/>
@@ -4653,7 +4653,7 @@
<integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1"/>
- <string>{{622, 457}, {241, 103}}</string>
+ <string>{{596, 538}, {238, 103}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
@@ -4668,7 +4668,7 @@
<integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1"/>
- <string>{{256, 236}, {280, 283}}</string>
+ <string>{{316, 598}, {280, 283}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1"/>
<string>{{654, 613}, {157, 223}}</string>
@@ -4700,7 +4700,7 @@
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1"/>
<string>{{449, 1007}, {197, 53}}</string>
- <string>{{666, 356}, {511, 20}}</string>
+ <string>{{133, 889}, {511, 20}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1"/>
<string>{{506, 836}, {511, 20}}</string>
@@ -4771,7 +4771,7 @@
<integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1"/>
- <string>{{678, 103}, {215, 253}}</string>
+ <string>{{180, 628}, {215, 253}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1"/>
<string>{{518, 583}, {218, 253}}</string>
@@ -4876,7 +4876,7 @@
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>{{214, 186}, {235, 333}}</string>
+ <string>{{772, 23}, {235, 333}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1"/>
<string>{{180, 535}, {182, 253}}</string>
diff --git a/Source/CMTextView.m b/Source/CMTextView.m
index c2aac5cf..d9ba59f4 100644
--- a/Source/CMTextView.m
+++ b/Source/CMTextView.m
@@ -67,6 +67,7 @@ YY_BUFFER_STATE yy_scan_string (const char *);
#define SP_CQ_SELECT_CURRENT_QUERY_MENU_ITEM_TAG 1002
#define SP_SYNTAX_HILITE_BIAS 2000
+#define SP_MAX_TEXT_SIZE_FOR_SYNTAX_HIGHLIGHTING 20000000
#define MYSQL_DOC_SEARCH_URL @"http://dev.mysql.com/doc/refman/%@/en/%@.html"
@@ -2792,6 +2793,8 @@ NSInteger alphabeticSort(id string1, id string2, void *reverse)
NSString *selfstr = [self string];
NSUInteger strlength = [selfstr length];
+ if(strlength > SP_MAX_TEXT_SIZE_FOR_SYNTAX_HIGHLIGHTING) return;
+
NSRange textRange;
// If text larger than SP_TEXT_SIZE_TRIGGER_FOR_PARTLY_PARSING
@@ -2990,7 +2993,7 @@ NSInteger alphabeticSort(id string1, id string2, void *reverse)
// Highlightes the current query if set in the Pref and no snippet session
// and if nothing is selected in the text view
- if ([self shouldHiliteQuery] && snippetControlCounter<=-1 && ![self selectedRange].length) {
+ if ([self shouldHiliteQuery] && snippetControlCounter<=-1 && ![self selectedRange].length && [[self string] length] < SP_MAX_TEXT_SIZE_FOR_SYNTAX_HIGHLIGHTING) {
NSUInteger rectCount;
[[self textStorage] ensureAttributesAreFixedInRange:[self queryRange]];
NSRectArray queryRects = [[self layoutManager] rectArrayForCharacterRange: [self queryRange]