- Notifications
You must be signed in to change notification settings - Fork65
Commit41a0253
committed
Fix patterns of provide_context gets panicked
This PR fixes two cases where provide_context panics even thoughthe previous call of `is_boundary` returns a PreContext error.The primary cause is `provide_context` assumes its state asRegional or Emoji; otherwise it gets panicked with 'invalid state!'However:- if the chunk starts with the cursor position, it requires pre-context for `cat_before` (and that's necessary for some cases indeed). so provide_context should fill `cat_before` in such case.- if both `cat_before` and `cat_after` are RIS and the boundary is undecided by the chunk, it requires pre-context but it does not set its state to Regional. This is done by setting state within `handle_regional`.1 parent611eaa7 commit41a0253
1 file changed
+24
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
360 | 360 | | |
361 | 361 | | |
362 | 362 | | |
363 | | - | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
364 | 367 | | |
365 | 368 | | |
366 | 369 | | |
| |||
406 | 409 | | |
407 | 410 | | |
408 | 411 | | |
| 412 | + | |
409 | 413 | | |
410 | 414 | | |
411 | 415 | | |
| |||
428 | 432 | | |
429 | 433 | | |
430 | 434 | | |
| 435 | + | |
431 | 436 | | |
432 | 437 | | |
433 | 438 | | |
| |||
659 | 664 | | |
660 | 665 | | |
661 | 666 | | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
0 commit comments
Comments
(0)