aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2009-05-19 17:42:02 +0000
committerBibiko <bibiko@eva.mpg.de>2009-05-19 17:42:02 +0000
commit1043c60fb5f69a25ca429051f90e53489feab715 (patch)
tree1fafc20acf95ada92c31d4f99406da8738acdbc0 /Source
parentf28c0520f420610e5ccca992bd60d648a9f8c84e (diff)
downloadsequelpro-1043c60fb5f69a25ca429051f90e53489feab715.tar.gz
sequelpro-1043c60fb5f69a25ca429051f90e53489feab715.tar.bz2
sequelpro-1043c60fb5f69a25ca429051f90e53489feab715.zip
• improved "Update Help while typing"
- it recognizes any keyDown event including arrow keys
Diffstat (limited to 'Source')
-rw-r--r--Source/CMTextView.m13
1 files changed, 9 insertions, 4 deletions
diff --git a/Source/CMTextView.m b/Source/CMTextView.m
index e7e0c46f..9a25dfd8 100644
--- a/Source/CMTextView.m
+++ b/Source/CMTextView.m
@@ -280,10 +280,13 @@ YY_BUFFER_STATE yy_scan_string (const char *);
- (void) keyDown:(NSEvent *)theEvent
{
- if([prefs boolForKey:@"CustomQueryAutohelp"]) // cancel autoHelp request
+ if([prefs boolForKey:@"CustomQueryAutohelp"]) {// restart autoHelp timer
[NSObject cancelPreviousPerformRequestsWithTarget:self
selector:@selector(autoHelp)
object:nil];
+ [self performSelector:@selector(autoHelp) withObject:nil
+ afterDelay:[[[prefs valueForKey:@"CustomQueryAutohelpDelay"] retain] floatValue]];
+ }
long allFlags = (NSShiftKeyMask|NSControlKeyMask|NSAlternateKeyMask|NSCommandKeyMask);
@@ -446,8 +449,6 @@ YY_BUFFER_STATE yy_scan_string (const char *);
// The default action is to perform the normal key-down action.
[super keyDown:theEvent];
- if([prefs boolForKey:@"CustomQueryAutohelp"])
- [self performSelector:@selector(autoHelp) withObject:nil afterDelay:[[[prefs valueForKey:@"CustomQueryAutohelpDelay"] retain] floatValue]];
}
@@ -1778,8 +1779,9 @@ YY_BUFFER_STATE yy_scan_string (const char *);
*/
- (void)autoHelp
{
+
if(![prefs boolForKey:@"CustomQueryAutohelp"]) return;
-
+
// If selection show Help for it
if([self selectedRange].length)
{
@@ -2068,6 +2070,9 @@ YY_BUFFER_STATE yy_scan_string (const char *);
//make sure that the notification is from the correct textStorage object
if (textStore!=[self textStorage]) return;
+ if([prefs boolForKey:@"CustomQueryAutohelp"])
+ [self performSelector:@selector(autoHelp) withObject:nil afterDelay:[[[prefs valueForKey:@"CustomQueryAutohelpDelay"] retain] floatValue]];
+
[NSObject cancelPreviousPerformRequestsWithTarget:self
selector:@selector(doSyntaxHighlighting)
object:nil];