Frodo45127 / rpfm

Rusted PackFile Manager (RPFM) is a... reimplementation in Rust and Qt5 of PackFile Manager (PFM), one of the best modding tools for Total War Games.
MIT License
357 stars 57 forks source link

When editing lua scripts, if you undo too far past your first change then it will remove all contents of the script #243

Open Volcano467 opened 1 year ago

Volcano467 commented 1 year ago

Hello,

If this has been reported before then I appologize, I looked and did not see it...

When editing a lua script, say you change a few things but then use CTRL+Z to undo. If you undo past your first edit in that session, then it will clear out the entire contents of the script (the screen will turn blank). It would be nice if you could undo up to your first undo, and then nothing else happens in the window.

As far as I can tell, the only thing you can do to get it back is to reload the .pack file.

Thanks!

UlrikHD commented 1 year ago

As far as I can tell, the only thing you can do to get it back is to reload the .pack file.

ctrl+shift+z is the command for redo, and will "undo" your undo. It's a shortcut that will work in most text editors and other editor programs.

Volcano467 commented 1 year ago

Ah, yes, I was trying to do that, but I guess I was pressing ctrl+y (habit from MS Word perhaps).

At least I can do do that to get it back when it happens. Of course it would be nice if it didn't dump the data like this, but ctrl+shift+z helps good enough if fixing that is a PITA. Thanks for the help!

Frodo45127 commented 1 year ago

It's a known issue. AFAIK the only way to fix it is to use a custom version of ktextedit which skips the first undo step when putting the text, which requires C++ knowledge that I lack, and will make redistribution on linux a bit harder.