godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.16k stars 97 forks source link

Add clear_undo_history() method to LineEdit #9207

Open MewPurPur opened 8 months ago

MewPurPur commented 8 months ago

Describe the project you are working on

SVG Editor

Describe the problem or limitation you are having in your project

TextEdit has a clear_undo_history() method. LineEdit doesn't have it, which is a bit limiting. When you construct a LineEdit, you often want it to start off a little filled. For a TextEdit, you can then erase the UndoRedo, but for LineEdit, you can Ctrl+Z back into the empty state. This is weird, since the user never edited it.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Implement this TextEdit method in LineEdit.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

Equivalent to TextEdit's implementation.

If this enhancement will not be used often, can it be worked around with a few lines of script?

It seems impossible.

Is there a reason why this should be core and not an add-on in the asset library?

TextEdit already has this in core.

MewPurPur commented 7 months ago

Seems like these things already pretty much exist, but are unexposed.

MewPurPur commented 1 month ago

Modified this proposal to reflect the point that's still missing.