CodeEditSourceEditor: ๐ Crash when deleting text
Description
I deleted a bunch of text from a file (select text + backspace), this caused CodeEdit to crash with the following error:
Thread 57: Fatal error: Duplicate elements of type 'LanguageLayer' were found in a Set.
This usually means either that the type violates Hashable's requirements, or
that members of such a set were mutated after insertion.
at editState.touchedLayers.insert(layer) (line 63 in TreeSitterClient+Edit)
To Reproduce
Open file, delete bunch of text. Iโm not sure if itโs easily reproducible
Expected Behavior
No crash
Version Information
CodeEditTextView: 0.6.4 macOS: 14.0 beta 1 Xcode: 15.0 beta 1
Additional Context
I attached a video showing the issue. It crashes when I press backspace. Iโm not sure, but it seems to only happen when I delete text that is at the start of the file. I havenโt seen it happen when I delete text in the middle of the file.
Screenshots
https://github.com/CodeEditApp/CodeEditTextView/assets/62355975/fc958100-a1d2-4e25-8a52-2486583ac385
No response
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 18
Commits related to this issue
- Move Layout Updates to NSTextStorage Delegate (#82) ### Description **Detailed Changes** - Makes `TextLayoutManager` a text storage delegate. - Updates `TextLayoutManager` to use the text storage me... — committed to CodeEditApp/CodeEditTextView by thecoolwinter 2 years ago
- Fix Text Disappearing (#88) ### Description Fixes two small bugs: - When deleting a line from the line text storage, a replaced node's left subtree metadata would be replaced, instead of added to wh... — committed to erickirt/CodeEditTextView by thecoolwinter 2 years ago
Hello @thecoolwinter. Thanks for the help! The problem is still there. Same as the video. ๐ญ I just updated to 0.10.0 and updated to using Attributes for the ThemeEditor.