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.
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
ConnectButtonPushedfunction, on this line of code:In my case,
pos2was 61 but the size oftxtwas 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), butConnectButtonPushedshould have a check for out-of-bounds positions.