From 38d4203d9ba8e80d401316a47d6b472103d926d2 Mon Sep 17 00:00:00 2001 From: Jared Crawford Date: Wed, 11 Apr 2012 03:45:27 -0300 Subject: [PATCH] Fixes a bug where location of the selection after a spell-checked replacement is beyond the length of the string. --- EGOTextView/EGOTextView.m | 1 + 1 file changed, 1 insertion(+) diff --git a/EGOTextView/EGOTextView.m b/EGOTextView/EGOTextView.m index cb5b4ef..38757a0 100644 --- a/EGOTextView/EGOTextView.m +++ b/EGOTextView/EGOTextView.m @@ -1444,6 +1444,7 @@ - (void)deleteBackward { [_mutableAttributedString beginEditing]; [_mutableAttributedString deleteCharactersInRange:self.correctionRange]; [_mutableAttributedString endEditing]; + selectedNSRange.location = self.correctionRange.location; self.correctionRange = NSMakeRange(NSNotFound, 0); selectedNSRange.length = 0;