aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/CustomQuery.m4
1 files changed, 4 insertions, 0 deletions
diff --git a/Source/CustomQuery.m b/Source/CustomQuery.m
index 79f55545..7df5615f 100644
--- a/Source/CustomQuery.m
+++ b/Source/CustomQuery.m
@@ -150,6 +150,10 @@
// and preserve the selection
[textView setSelectedRange:NSMakeRange(selectedRange.location, 0)];
[textView insertText:@""];
+
+ // Inserting empty text may have cancelled a partial accent - range check before
+ // restoring the selection.
+ if (selectedRange.location > [[textView string] length]) selectedRange.location = [[textView string] length];
[textView setSelectedRange:selectedRange];
reloadingExistingResult = NO;