Fix autocorrection

This commit is contained in:
Ali 2021-07-07 22:56:39 +04:00
parent 2a09dda7d9
commit be37c1e3c4

View File

@ -317,7 +317,14 @@ static NSString *TGEncodeText(NSString *string, int key)
}
void applyKeyboardAutocorrection(UITextView * _Nonnull textView) {
NSRange rangeCopy = textView.selectedRange;
NSRange fakeRange = rangeCopy;
if (fakeRange.location != 0) {
fakeRange.location--;
}
[textView unmarkText];
[textView setSelectedRange:fakeRange];
[textView setSelectedRange:rangeCopy];
}
@interface AboveStatusBarWindowController : UIViewController