aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/SPNarrowDownCompletion.m2
1 files changed, 2 insertions, 0 deletions
diff --git a/Source/SPNarrowDownCompletion.m b/Source/SPNarrowDownCompletion.m
index 04627e2d..eaf36e4f 100644
--- a/Source/SPNarrowDownCompletion.m
+++ b/Source/SPNarrowDownCompletion.m
@@ -1002,6 +1002,7 @@
if ([[theView textStorage] attribute:kSPAutoCompletePlaceholderName atIndex:scanPosition longestEffectiveRange:&attributeResultRange inRange:NSMakeRange(scanPosition, currentLength-scanPosition)]) {
// A match was found - attributeResultRange contains the range of the attributed string
+ [theView shouldChangeTextInRange:attributeResultRange replacementString:@""];
[[theView textStorage] deleteCharactersInRange:attributeResultRange];
} else {
@@ -1012,6 +1013,7 @@
// A match was found - retrieve the location
NSUInteger matchStart = attributeResultRange.location+attributeResultRange.length;
if ([[theView textStorage] attribute:kSPAutoCompletePlaceholderName atIndex:matchStart longestEffectiveRange:&attributeResultRange inRange:NSMakeRange(matchStart, currentLength - matchStart)]) {
+ [theView shouldChangeTextInRange:attributeResultRange replacementString:@""];
[[theView textStorage] deleteCharactersInRange:attributeResultRange];
}
}