From 4bd80e43ae255768c57095cfaa45f2ff6859a1bd Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Sun, 9 May 2010 23:27:05 +0000 Subject: - Fix a problem caused when trying to run custom queries terminated by a partial letterform, eg an unapplied accent. (Addresses http://spbug.com/l/260) --- Source/CustomQuery.m | 4 ++++ 1 file changed, 4 insertions(+) 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; -- cgit v1.2.3