Commit e4c5c68
committed
Fix: Keep typing scheduling invariant from version < 2
Before version 2, characters would be typed in the following order:
1. Update characters and lines state (i.e. render character in a line)
2. After being rendered, call onCharacterTyped
3. Generate a new delay for the given line and character that was just rendered
4. Set a timeout with the generated delay
After the introduction of Backspace and Delay elements in v2, the order
in which characters were typed was changed, changing the invariant of
when the delayGenerator was called and how delays were scheduled.
This was due to conflation between the newly introduced delays and the
normal typing scheduling.
This commit fixes that1 parent 8e759d6 commit e4c5c68
3 files changed
+40
-34
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
127 | | - | |
| 127 | + | |
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
131 | | - | |
| 131 | + | |
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
| |||
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
159 | 163 | | |
160 | | - | |
161 | | - | |
162 | | - | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
163 | 167 | | |
164 | | - | |
165 | | - | |
166 | | - | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
167 | 174 | | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | 175 | | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
176 | 180 | | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
183 | 187 | | |
184 | 188 | | |
185 | 189 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
4 | 6 | | |
5 | 7 | | |
6 | 8 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
52 | 53 | | |
53 | 54 | | |
54 | | - | |
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| |||
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
| 174 | + | |
174 | 175 | | |
175 | 176 | | |
176 | | - | |
177 | 177 | | |
| 178 | + | |
178 | 179 | | |
179 | 180 | | |
180 | | - | |
181 | 181 | | |
182 | 182 | | |
183 | 183 | | |
| |||
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
| 197 | + | |
197 | 198 | | |
198 | 199 | | |
199 | | - | |
200 | 200 | | |
| 201 | + | |
201 | 202 | | |
202 | 203 | | |
203 | | - | |
204 | 204 | | |
205 | 205 | | |
206 | 206 | | |
| |||
0 commit comments