-
-
Notifications
You must be signed in to change notification settings - Fork 22k
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
TextEdit caret line selection raises: Index p_column = N is out of bounds #72797
Comments
The same error happens when using "Convert Indent to Tabs" instead of indent/unindent (but I'm too lazy to make another gif). I think it always happens when the selected line gets shorter |
Working on it. There's more to this bug than meets the eye, though I'm not going to open separate bug reports. If someone else wants to work on this now, please poke me so I can explain, I'll keep trying to solve it myself for now |
I explained what causes the bug and a possible easy patch in the PR above. Though right now, I'm trying to rework the TextEdit selection system to be simpler and less bug-prone. |
Can you still reproduce this in 4.0.3 and 4.1-beta3 or later? |
@akien-mga yes |
Yeah, nothing about the underlying problems was solved. Text selection still needs an overhaul and to consistently be updated when text with selections is moved. |
I found another way this happens:
I'm running v4.1.rc1.official [1f9e540] NOTE: Even though I'm demonstrating at the end of the script, the same happens if I do it anywhere in the middle of the script. Also, I believe #74400 is the same issue. |
Yeah, everything that can remove characters from a line while its end is selected would have this issue; untoggling comments is one of those things. Again, the PR I made above that was closed explains it, it's just hard to solve. Me and Paulb seem to have settled down on needing to rework the whole text selection system of TextEdit to rely on less information and to update said information more consistently, since the problem is that when a line is updated, we don't update the "pivot" of the selection. Ideally, the pivot should be a bool saying if it's the beginning or the end of the selection, which would make it impossible that it goes to an invalid position. I'm looking to make this change in LineEdit first - I started it, but got burned out with the script editor 😓 still on my plans, hopefully I can make the refactor for 4.2 |
Godot version
4.0.beta17
System information
Linux
Issue description
This issue is very similar to #69011 and #69055 but I ran into this error in latest beta.
Steps to reproduce
Minimal reproduction project
not needed
The text was updated successfully, but these errors were encountered: