Skip to content
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

Multi caret undo breaks after typing too many characters #80624

Open
gokiburikin opened this issue Aug 14, 2023 · 3 comments
Open

Multi caret undo breaks after typing too many characters #80624

gokiburikin opened this issue Aug 14, 2023 · 3 comments

Comments

@gokiburikin
Copy link

Godot version

v4.1.stable.official [9704596]

System information

Windows 10

Issue description

When replacing many instances of text with multi caret editing, if you replace it by typing too many characters the undo stack breaks with an error message scene/gui/text_edit.cpp:4002 - Condition "!undo_stack_pos->prev()" is true. Breaking.

Steps to reproduce

Multi caret select a lot of text and replace it by typing new text. Attempt to undo.

Godot_v4.1-stable_win64_2023-08-14_11-35-24.mp4

Minimal reproduction project

N/A

@TheSofox
Copy link
Contributor

Tagging @Paulb23 since they implemented Multi-caret editing.

@TheSofox
Copy link
Contributor

TheSofox commented Nov 24, 2023

Found the cause, basically the undo queue hits it maximum. Setting is in Project Settings -> GUI -> Common -> Text Edit Undo Stack Max Size: https://docs.godotengine.org/en/stable/classes/class_projectsettings.html#class-projectsettings-property-gui-common-text-edit-undo-stack-max-size

By default it's 1024. Each individual character change counts as an action. So if you've got 20 line multi carat, you can type just over 50 characters in one go before you hit the limit and undoing the operations results in an error. (20 x 50 =1000)

You can raise this limit (though you may need to restart to take effect) and it'll be able to take more characters. I'm not sure if this counts as a solution.

@Paulb23
Copy link
Member

Paulb23 commented Dec 7, 2023

it's a known limitation, increasing the undo queue is the best solution for now, without having to re-write undo / redo in TextEdit

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

No branches or pull requests

4 participants