Skip to content

🐞 Crash when deleting text #196

Description

@Wouter01

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

Screen.Recording.2023-06-14.at.20.19.00.mov

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions