-
-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Demo crashes when editing text #39
Comments
Ok, first crash is caused by a bogus |
Ok, test to expose the bug and confirm fix done. Kind of a dumb mistake. |
That one was a bit of a special-case though. Any edit at a location < the ending will also almost certainly fail. This is because the |
Ok, I think that one is resolved too. I bet these aren't the last, but I really appreciate you reporting them! |
Thanks a lot! I can confirm that both cases seem to be solved now. There seem to be some more cases where the first assertion will fail (assertionFailure (RangeMutation.swift -> transform(location:), line 84)). Some that I noticed:
When trying to remove the last character, another assertion will fail: |
Ok one of these was easy. Tests expanded, bug exposed and fixed. But there's still at least one range management bug lurking. Just so you know, the reason this stuff is so strict is because the entire system works on deltas. If even one is wrong, all future calculations won't ever work right again. |
OK more progress. I fixed another serious limit calculation, and also removed a check that was left-over from some now-removed code. Things are better. But, the example isn't re-highlighting correctly on changes. Any more crashes? |
invalidation problem: #40 |
Yup, can't find any crashes anymore! Thank you! |
The demo project provided in the repo will crash when trying to edit the text.
Some checks seem to fail, and it looks like it depends where in the text something is edited.
Here are the cases that I found:
Put cursor at end of last line, press enter:
assertionFailure (RangeMutation.swift -> transform(location:), line 84)
Put cursor after
let
, typea
:assertionFailure("location is greater than end") (String+Data.swift -> data(at:limit:using:chunkSize:), line 19)
The text was updated successfully, but these errors were encountered: