nbdev-vscode icon indicating copy to clipboard operation
nbdev-vscode copied to clipboard

Cleaning the notebook erases undo history

Open Taytay opened this issue 2 years ago • 4 comments

This makes sense, but code formatters don't seem to have this problem. Could this be done in a similar way somehow, so that I can keep the ability to undo?

Taytay avatar Apr 03 '23 04:04 Taytay

I'm not sure tbh are you able to undo the similar action in a jupyter notebook after a clean operation?

hamelsmu avatar Apr 03 '23 04:04 hamelsmu

Once we finalize onWillSaveNotebookDocument in VS Code, maybe we could listen to this event and return edits for it so VS Code can handle the edit and also undo/redo for it automatically.

It seems right now nbdev is editing the ipynb file directly, is this correct @hamelsmu ?

rebornix avatar Apr 04 '23 03:04 rebornix

That's correct I didn't realize there was a way to submit edits I'll look into that

hamelsmu avatar Apr 04 '23 03:04 hamelsmu

I'm not sure tbh are you able to undo the similar action in a jupyter notebook after a clean operation?

I'm too new to the world of Notebooks to know! This is my first time cleaning them :)

Taytay avatar Apr 04 '23 05:04 Taytay