Browse Source

Testing silenced errors

Anatoly Pulyaevskiy 6 years ago
parent
commit
fd08c9aea2

+ 4
- 1
packages/notus/lib/src/document.dart View File

130
     assert(index >= 0 && length > 0);
130
     assert(index >= 0 && length > 0);
131
     // TODO: need a heuristic rule to ensure last line-break.
131
     // TODO: need a heuristic rule to ensure last line-break.
132
     final change = _heuristics.applyDeleteRules(this, index, length);
132
     final change = _heuristics.applyDeleteRules(this, index, length);
133
-    if (change.isNotEmpty) compose(change, ChangeSource.local);
133
+    // Delete rules are allowed to prevent the edit.
134
+//    if (change.isNotEmpty) {
135
+      compose(change, ChangeSource.local);
136
+//    }
134
     return change;
137
     return change;
135
   }
138
   }
136
 
139
 

+ 1
- 1
packages/notus/pubspec.yaml View File

14
 
14
 
15
 dev_dependencies:
15
 dev_dependencies:
16
   test: ^1.0.0
16
   test: ^1.0.0
17
-  test_coverage: ^0.2.0
17
+  test_coverage: ^0.2.1

+ 2
- 0
packages/zefyr/lib/src/widgets/controller.dart View File

101
   void replaceText(int index, int length, String text,
101
   void replaceText(int index, int length, String text,
102
       {TextSelection selection}) {
102
       {TextSelection selection}) {
103
     Delta delta;
103
     Delta delta;
104
+
104
     if (length > 0 || text.isNotEmpty) {
105
     if (length > 0 || text.isNotEmpty) {
105
       delta = document.replace(index, length, text);
106
       delta = document.replace(index, length, text);
106
     }
107
     }
108
+
107
     if (selection != null) {
109
     if (selection != null) {
108
       if (delta == null) {
110
       if (delta == null) {
109
         _updateSelectionSilent(selection, source: ChangeSource.local);
111
         _updateSelectionSilent(selection, source: ChangeSource.local);