aboutsummaryrefslogtreecommitdiffstats
path: root/Source/CMTextView.m
diff options
context:
space:
mode:
Diffstat (limited to 'Source/CMTextView.m')
-rw-r--r--Source/CMTextView.m13
1 files changed, 12 insertions, 1 deletions
diff --git a/Source/CMTextView.m b/Source/CMTextView.m
index fae2554a..0a753007 100644
--- a/Source/CMTextView.m
+++ b/Source/CMTextView.m
@@ -131,6 +131,7 @@ NSInteger alphabeticSort(id string1, id string2, void *reverse)
mirroredCounter = -1;
completionIsOpen = NO;
isProcessingMirroredSnippets = NO;
+ completionWasRefreshed = NO;
lineNumberView = [[NoodleLineNumberView alloc] initWithScrollView:scrollView];
[scrollView setVerticalRulerView:lineNumberView];
@@ -542,6 +543,13 @@ NSInteger alphabeticSort(id string1, id string2, void *reverse)
}
+- (void) refreshCompletion
+{
+ if(completionWasRefreshed) return;
+ completionWasRefreshed = YES;
+ [self doCompletionByUsingSpellChecker:NO fuzzyMode:completionFuzzyMode autoCompleteMode:NO];
+}
+
- (void) doCompletionByUsingSpellChecker:(BOOL)isDictMode fuzzyMode:(BOOL)fuzzySearch autoCompleteMode:(BOOL)autoCompleteMode
{
@@ -556,6 +564,9 @@ NSInteger alphabeticSort(id string1, id string2, void *reverse)
}
[self breakUndoCoalescing];
+
+ // Remember state for refreshCompletion
+ completionFuzzyMode = fuzzySearch;
NSUInteger caretPos = NSMaxRange([self selectedRange]);
@@ -1999,7 +2010,7 @@ NSInteger alphabeticSort(id string1, id string2, void *reverse)
if ([theEvent keyCode] == 53 && [self isEditable]){ // ESC key for internal completion
[self setCompletionWasReinvokedAutomatically:NO];
-
+ completionWasRefreshed = NO;
// Cancel autocompletion trigger
if([prefs boolForKey:SPCustomQueryAutoComplete])
[NSObject cancelPreviousPerformRequestsWithTarget:self