aboutsummaryrefslogtreecommitdiffstats
path: root/Source/NoodleLineNumberView.m
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2009-05-07 08:29:42 +0000
committerBibiko <bibiko@eva.mpg.de>2009-05-07 08:29:42 +0000
commit166b844e7a4e84b79d2cfad5cac1d5d8333988f5 (patch)
tree21b9eb5bd92f22e4114688c0aaaf11d231a1efb4 /Source/NoodleLineNumberView.m
parent2a4bbd2e425fbbf0ffd20a9c36921778b92963ae (diff)
downloadsequelpro-166b844e7a4e84b79d2cfad5cac1d5d8333988f5.tar.gz
sequelpro-166b844e7a4e84b79d2cfad5cac1d5d8333988f5.tar.bz2
sequelpro-166b844e7a4e84b79d2cfad5cac1d5d8333988f5.zip
• added "Query Editor" preference pane for setting colors, font, and modes (from the CQ's action gear which are still customizable there)
- in addition to the syntax colors it's now possible to change the fore/background color as well • added "Update Help while typing" feature in the Custom Query editor • first trial to improve syntax highlighting for large text in the Custom Query editor - if the text is larger than 10k the highlighting is performed only for the visible text area ±bias (3.5k) - if the user changes the visible area the highlighting follows time-delayed 500ms) to assure user interaction - a test with a 45MB SQL dump worked (of course a tick slowier) -- todo: improve prev/current query detection (mainly the SQLParser) - if the text size is > 6MB the completion list won't show words from the text due to parsing time - if the text size is > 6MB the line numbering will be disabled due to performance issue (improvements should follow) • some tiny clarification changes in the syntax highlighting code • some minor code cosmetics
Diffstat (limited to 'Source/NoodleLineNumberView.m')
-rw-r--r--Source/NoodleLineNumberView.m8
1 files changed, 8 insertions, 0 deletions
diff --git a/Source/NoodleLineNumberView.m b/Source/NoodleLineNumberView.m
index a4383102..1c5e8281 100644
--- a/Source/NoodleLineNumberView.m
+++ b/Source/NoodleLineNumberView.m
@@ -240,6 +240,14 @@
text = [view string];
stringLength = [text length];
+ // Switch off line numbering if text larger than 6MB
+ // for performance reasons.
+ // TODO improve performance maybe via threading
+ if(stringLength>6000000)
+ {
+ NSLog(@"Line Numbering switched off. Text length larger than 6MB.");
+ return;
+ }
[lineIndices release];
lineIndices = [[NSMutableArray alloc] init];