eclipse-platform / .github

Common contribution content for eclipse-platform repositories
https://www.eclipse.org/eclipse/
5 stars 10 forks source link

Eclipse deletes your code #99

Closed andreasdc closed 1 year ago

andreasdc commented 1 year ago

When you undo typing and then redo typing with shortcut and you press any key for example h instead of y, it will delete all of the code that you had to redo.

merks commented 1 year ago

Yes, that's true. But it's also what I see in other editors like Word. There is a command stack so you can undo changes. This moves through the stack while the undone changes remains available for redo. But as soon as you do anything other than an undo or redo, the redo part of the stack is wiped away, replaced with the command (changes) you just made.

andreasdc commented 1 year ago

Yes, that's true. But it's also what I see in other editors like Word. There is a command stack so you can undo changes. This moves through the stack while the undone changes remains available for redo. But as soon as you do anything other than an undo or redo, the redo part of the stack is wiped away, replaced with the command (changes) you just made.

Nope, for example Notepad++ doesn't ruin the history.

merks commented 1 year ago

This is what Word too does so the current behavior is not unreasonable and is working as expected. If Notepad++ sets different expectations, that might well be the case, but there are no plans to change this.

andreasdc commented 1 year ago

Well you should add the fix or protection, because its easy to lose all of your code.

laeubi commented 1 year ago

You should not use the undo/redo buffer for that, use version control systems for that so you do not "lose all your code".

Beside that, Eclipse has a nice feature, rightclick on the file and then choose "Compare With" > Local History, this records changes you made in a history style so if you accidentally deleted a large codeblock it can most of the time recovered from there.