Skip to content

Commit ec366db

Browse files
author
Ignacio Romero Zurbuchen
committed
Solves a crash some users were experiencing when auto-completing with the dictation input mode.
1 parent a3f4bc9 commit ec366db

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Source/SLKTextViewController.m

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1154,9 +1154,17 @@ - (void)slk_enableTypingSuggestionIfNeeded
11541154

11551155
BOOL enable = !self.isAutoCompleting;
11561156

1157+
NSString *inputPrimaryLanguage = self.textView.textInputMode.primaryLanguage;
1158+
11571159
// Toggling autocorrect on Japanese keyboards breaks autocompletion by replacing the autocompletion prefix by an empty string.
11581160
// So for now, let's not disable autocorrection for Japanese.
1159-
if ([self.textView.textInputMode.primaryLanguage isEqualToString:@"ja-JP"]) {
1161+
if ([inputPrimaryLanguage isEqualToString:@"ja-JP"]) {
1162+
return;
1163+
}
1164+
1165+
// Let's avoid refreshing the text view while dictation mode is enabled.
1166+
// This solves a crash some users were experiencing when auto-completing with the dictation input mode.
1167+
if ([inputPrimaryLanguage isEqualToString:@"dictation"]) {
11601168
return;
11611169
}
11621170

0 commit comments

Comments
 (0)