YarnClassic icon indicating copy to clipboard operation
YarnClassic copied to clipboard

Undo hotkey clears node text

Open Firemaw opened this issue 5 years ago • 5 comments

Windows 10, Yarn Spinner v0.4.124

Open a filled node and press Ctrl+Z - it clears all text out.

Firemaw avatar Feb 18 '21 03:02 Firemaw

ah interesting - I thought we had that fixed. Maybe broke again along the way? https://github.com/YarnSpinnerTool/YarnEditor/pull/238 @FaultyFunctions

blurymind avatar Feb 18 '21 17:02 blurymind

This is only fixed if you enter text into a node and close and reopen the node during that session.. If you open a new session the clear text behavior still exists since YarnEditor isn't saving the Ace UndoManager so it doesn't persist between sessions. It's only stored in internal memory for that session.

We'd need to implement some way of saving the data in between sessions to truly save undo history between sessions. With JSON that should be no problem, but the Yarn file might be a bit trickier to save an object like that.

FaultyFunctions avatar Feb 18 '21 18:02 FaultyFunctions

Perhaps the behavior should be Ctrl+Z shouldn't do anything if there is no edit history, instead of just clearing the entire node? At least for the time being until edit history is implemented to persist between sessions?

FaultyFunctions avatar Feb 20 '21 08:02 FaultyFunctions

Perhaps the behavior should be Ctrl+Z shouldn't do anything if there is no edit history, instead of just clearing the entire node? At least for the time being until edit history is implemented to persist between sessions?

I agree, if there is no edit history in the node, I expect Ctrl+Z to do nothing. To be honest I wouldn't expect Ctrl+Z to persist between sessions, no other apps I know of do that (if you are talking about closing and restarting the app).

Firemaw avatar Feb 20 '21 08:02 Firemaw

Yeah I was thinking about that too. It might be nice but def not needed. Not sure how many people would use it to be honest. Let's just stick with having Ctrl + Z not do anything if there is no history for now. I don't think we'd need to implement undo history persistence between sessions, but that can be a discussion for a different day.

FaultyFunctions avatar Feb 20 '21 08:02 FaultyFunctions