Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undo doesn't restore the new changes(since file was saved) and they are thus lost #18

Closed
ghost opened this issue Jun 11, 2014 · 2 comments

Comments

@ghost
Copy link

ghost commented Jun 11, 2014

Hi.

Sometimes Undo loses my new text and only restores what was there before, from the last file save.

Example:

  1. enter the text "abc" in a cell, move away from the cell.
  2. save the file and move back on the cell.
  3. press Enter or F2 to edit
  4. append def, so now looks "abcdef", move away from the cell
  5. come back to the cell, press Enter of F2 to edit it, notice the text is selected already
  6. press a character which will replace the text
  7. press Ctrl+Z aka Undo: notice that this restores the text to "abc" not "abcdef"
    pressing Ctrl+Y aka Redo won't restore the lost "def" part which is lost forever, apparently.

Alternatives(choose one of the following to modify the above steps):

  • at step 7. pressing Esc instead of Undo will have the same effect, apparently
  • at step 6. if you press Esc, instead of the char to replace, the text gets replaced from "abcdef" to "abc", but Ctrl+Y aka Redo will work to restore it back to "abcdef"

Workarounds:

  • if in step 4. you also add a new cell, this will make Undo work fine for "abcdef"
  • at step 4: save the file
@aardappel
Copy link
Owner

Yes, it coalesces undos to the same cells to save memory, and apparently also does that accross a save boundary. I could either record that as a save boundary, or maybe instead I should just delete the undo buffer when you save. It is sometimes useful to undo past a save, but this would also be a lot more memory efficient...

@aardappel
Copy link
Owner

Ok, just pushed a fix for it undoing past the save boundary. As a bonus, it now also only coalesces undos within a word, rather than the whole cell.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant