Skip to content

Error if cursor is at the last character (empty new line) of a file #1

Description

@benjaminkraus

If your cursor is located at the very last line of your function, which happens to be an empty line, you can get an error from within ConnectButtonPushed function, on this line of code:

codeLine = txt(pos1:pos2);

In my case, pos2 was 61 but the size of txt was only 60 characters, so I got the error: "Index exceeds the number of array elements. Index must not exceed 60."

I can't tell if the bug is actually within positionInLineToIndex (which is returning a value past the end of the file), but ConnectButtonPushed should have a check for out-of-bounds positions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions