PavelTorgashov / FastColoredTextBox

Fast Colored TextBox for Syntax Highlighting. The text editor component for .NET.
Other
1.21k stars 463 forks source link

CTRL+Z undo clears the text #230

Closed freaker10k closed 1 year ago

freaker10k commented 3 years ago

In my code I have set FTB.Text = "a bunch of text"

When I load, it shows the text in the FTB as expected, yet if I use CTRL+Z it clears all of the text, with no way to get it back.

This is a problem because content risks being accidentally deleted.

Is there a way to prevent this?

Thank you

freaker10k commented 3 years ago

Update:

It appears that adding FTB.ClearUndo()

After the .Text is assigned solves the issue.

Hexman768 commented 1 year ago

Could you close this issue since you have resolved it?