We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Thanks for your great jobs, when I use EGOTextView, I found two bugs:
I try fixed it, hope useful:
(void)setMarkedText:(NSString *)markedText selectedRange:(NSRange)selectedRange {
NSRange selectedNSRange = self.selectedRange; NSRange markedTextRange = self.markedRange;
NSAttributedString *newString = [[NSAttributedString alloc] initWithString:markedText attributes:self.defaultAttributes];
if (markedTextRange.location != NSNotFound) { if (!markedText) markedText = @"";
[_mutableAttributedString replaceCharactersInRange:markedTextRange withAttributedString:newString]; / fixed for bug 2 markedTextRange.length = markedText.length;
} else if (selectedNSRange.length > 0) {
[_mutableAttributedString replaceCharactersInRange:selectedNSRange withAttributedString:newString]; // fixed for bug 2 markedTextRange.location = selectedNSRange.location; markedTextRange.length = markedText.length;
} else {
[_mutableAttributedString insertAttributedString:newString atIndex:selectedNSRange.location]; markedTextRange.location = selectedNSRange.location; markedTextRange.length = markedText.length;
}
[newString release]; selectedNSRange = NSMakeRange(selectedRange.location + markedTextRange.location, selectedRange.length);
self.attributedString = _mutableAttributedString; // fixed for bug1 self.markedRange = markedTextRange; self.selectedRange = selectedNSRange;
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Thanks for your great jobs, when I use EGOTextView, I found two bugs:
I try fixed it, hope useful:
(void)setMarkedText:(NSString *)markedText selectedRange:(NSRange)selectedRange {
NSRange selectedNSRange = self.selectedRange;
NSRange markedTextRange = self.markedRange;
NSAttributedString *newString = [[NSAttributedString alloc] initWithString:markedText attributes:self.defaultAttributes];
if (markedTextRange.location != NSNotFound) {
if (!markedText)
markedText = @"";
} else if (selectedNSRange.length > 0) {
} else {
}
[newString release];
selectedNSRange = NSMakeRange(selectedRange.location + markedTextRange.location, selectedRange.length);
self.attributedString = _mutableAttributedString; // fixed for bug1
self.markedRange = markedTextRange;
self.selectedRange = selectedNSRange;
}
The text was updated successfully, but these errors were encountered: