aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2011-08-26 23:52:23 +0000
committerrowanbeentje <rowan@beent.je>2011-08-26 23:52:23 +0000
commit6d2a8515b8a1d3e87b7ef0552696c94368177e52 (patch)
treebd4d60fcfb2f316cc63567617d0d3e31390aceea /Source
parent937786724187f7301b429673b77579912cae62c9 (diff)
downloadsequelpro-6d2a8515b8a1d3e87b7ef0552696c94368177e52.tar.gz
sequelpro-6d2a8515b8a1d3e87b7ef0552696c94368177e52.tar.bz2
sequelpro-6d2a8515b8a1d3e87b7ef0552696c94368177e52.zip
- Fix issues undoing past an autocompletion type-through, addressing exceptions (log #1847)
Diffstat (limited to 'Source')
-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];
}
}