aboutsummaryrefslogtreecommitdiffstats
path: root/Source/CMTextView.m
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2010-03-31 14:50:04 +0000
committerBibiko <bibiko@eva.mpg.de>2010-03-31 14:50:04 +0000
commit8138d4dd043991af0472299711e254433ab6591a (patch)
treec9e7dd11ba3d6e6d45bff018e7631417de933e63 /Source/CMTextView.m
parent9915b358dc414995bfb454781750d99d3cf36117 (diff)
downloadsequelpro-8138d4dd043991af0472299711e254433ab6591a.tar.gz
sequelpro-8138d4dd043991af0472299711e254433ab6591a.tar.bz2
sequelpro-8138d4dd043991af0472299711e254433ab6591a.zip
• if document window will close sent a 'cancelPreviousPerformRequestsWithTarget' to the custom query editor to stop auto-completion and auto-help timer to avoid crashes after closing
• improved some minor stuff for completion's re-invocation
Diffstat (limited to 'Source/CMTextView.m')
-rw-r--r--Source/CMTextView.m5
1 files changed, 3 insertions, 2 deletions
diff --git a/Source/CMTextView.m b/Source/CMTextView.m
index 91be7257..004eea93 100644
--- a/Source/CMTextView.m
+++ b/Source/CMTextView.m
@@ -519,13 +519,14 @@ NSInteger alphabeticSort(id string1, id string2, void *reverse)
- (void) doAutoCompletion
{
+ if(completionIsOpen || !self || ![self delegate]) return;
+
// Cancel autocompletion trigger
if([prefs boolForKey:SPCustomQueryAutoComplete])
[NSObject cancelPreviousPerformRequestsWithTarget:self
selector:@selector(doAutoCompletion)
object:nil];
- if(completionIsOpen) return;
NSRange r = [self selectedRange];
@@ -539,6 +540,7 @@ NSInteger alphabeticSort(id string1, id string2, void *reverse)
if([[NSApp keyWindow] firstResponder] == self)
[self doCompletionByUsingSpellChecker:NO fuzzyMode:NO autoCompleteMode:YES];
}
+
}
- (void) doCompletionByUsingSpellChecker:(BOOL)isDictMode fuzzyMode:(BOOL)fuzzySearch autoCompleteMode:(BOOL)autoCompleteMode
@@ -3280,7 +3282,6 @@ NSInteger alphabeticSort(id string1, id string2, void *reverse)
selector:@selector(doAutoCompletion)
object:nil];
-
// Remove observers
[[NSNotificationCenter defaultCenter] removeObserver:self];
[prefs removeObserver:self forKeyPath:SPCustomQueryEditorFont];