|
@@ -103,14 +103,27 @@ class InputConnectionController implements TextInputClient {
|
103
|
103
|
_sentRemoteValues.remove(value);
|
104
|
104
|
return;
|
105
|
105
|
}
|
106
|
|
-
|
107
|
|
- final effectiveLastKnownValue = _lastKnownRemoteTextEditingValue;
|
108
|
|
- _lastKnownRemoteTextEditingValue = value;
|
109
|
|
- final oldText = effectiveLastKnownValue.text;
|
110
|
|
- final text = value.text;
|
111
|
|
- final cursorPosition = value.selection.extentOffset;
|
112
|
|
- final diff = fastDiff(oldText, text, cursorPosition);
|
113
|
|
- onValueChanged(diff.start, diff.deleted, diff.inserted, value.selection);
|
|
106
|
+ // Note Flutter (unintentionally?) silences errors occurred during
|
|
107
|
+ // text input update, so we have to report it ourselves.
|
|
108
|
+ // For more details see https://github.com/flutter/flutter/issues/19191
|
|
109
|
+ // TODO: remove try-catch when/if Flutter stops silencing these errors.
|
|
110
|
+ try {
|
|
111
|
+ final effectiveLastKnownValue = _lastKnownRemoteTextEditingValue;
|
|
112
|
+ _lastKnownRemoteTextEditingValue = value;
|
|
113
|
+ final oldText = effectiveLastKnownValue.text;
|
|
114
|
+ final text = value.text;
|
|
115
|
+ final cursorPosition = value.selection.extentOffset;
|
|
116
|
+ final diff = fastDiff(oldText, text, cursorPosition);
|
|
117
|
+ onValueChanged(diff.start, diff.deleted, diff.inserted, value.selection);
|
|
118
|
+ } catch (e, trace) {
|
|
119
|
+ FlutterError.reportError(new FlutterErrorDetails(
|
|
120
|
+ exception: e,
|
|
121
|
+ stack: trace,
|
|
122
|
+ library: 'Zefyr',
|
|
123
|
+ context: 'while updating editing value',
|
|
124
|
+ ));
|
|
125
|
+ rethrow;
|
|
126
|
+ }
|
114
|
127
|
}
|
115
|
128
|
|
116
|
129
|
//
|