Hello!
I love the Jupyter Notebook and I use it extensively in my research. However, there is one feature that has been nagging me for a while.
My browser (Chrome on MacOS) sends several keydown events when I'm using the keyboard shortcuts in the notebook. Holding the S button will perform several saves, and holding the X button for 1 - 2 seconds will remove all the cells in the notebook (holding D does the same but slower).
I don't know if is because my fingers are too fat, that I have bad coordination or both... But I accidentally delete cells from time to time (mainly because X is so close to the Cmd-button). Since there is only one undo step, the results can be devastating.
Is there a solution to this that I have missed?
Otherwise I suggest adding a popup, or implementing one of the approaches outlined in the answers here: http://stackoverflow.com/questions/7686197/how-can-i-avoid-autorepeated-keydown-events-in-javascript
I think this is the part that causes the problem:
https://github.com/jupyter/notebook/blob/master/notebook/static/notebook/js/keyboardmanager.js#L130
Unfortunately, the way keyboard event works, it is difficult to get that right across browser/os/keyboard layout/user preference. Especially as this piece of code also handle multiple keypress for shortcuts.
The multiple undo stack is complex to implement, probably doable, but not that easy.
Can you maybe change the repeat frequency of your keys to mitigate that ? The current refactor might allow to have bette undo at some point.
I would like to bring this issue again to the attention of the Jupyter community.
This feature would be highly useful.
Several users have been suggesting it as well on other threads, e.g : https://github.com/jupyter/notebook/issues/712.
That issue was closed when #969 implemented an undo stack for deleted cells, released in notebook 5.0. Does that work for you?
hi People,
I can't believe we are so smart to create Jupiter notebook and so STUPID to not be able to recover more than only one cell deleted accidentaly. I lost my whole work of yesterday because apparently I pressed 'X' two times unnoticing it. being unable to undo that is completely stupid, apart from making so many people loose their work all the time.
In the current notebook, I can undo multiple cell deletions, not just the most recent cell (as @takluyver mentioned above, implemented in #969).
https://github.com/jupyter/notebook/pull/969#issuecomment-366844684 also mentions another technique to recover code that was executed in the current session.
Most helpful comment
I would like to bring this issue again to the attention of the Jupyter community.
This feature would be highly useful.
Several users have been suggesting it as well on other threads, e.g : https://github.com/jupyter/notebook/issues/712.