question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ctrl + Z should undo the cell changes first (Or should not undo the outputs)

See original GitHub issue

Environment data

  • VS Code version: 1.55.2
  • Jupyter Extension version (available under the Extensions sidebar): v2021.5.745244803
  • Python Extension version (available under the Extensions sidebar): v2021.4.765268190
  • OS (Windows | Mac | Linux distro) and version: Windows 10
  • Python and/or Anaconda version: N/A
  • Type of virtual environment used (N/A | venv | virtualenv | conda | …): N/A
  • Jupyter server running: Local | Remote | N/A

Expected behaviour

Ctrl + Z should undo changes in the cell if cell has been focused. And I’m also not sure should Ctrl+Z can undo the outputs? (IMO: Not)

Actual behaviour

Outputs will be undone rather than the cell.

Steps to reproduce:

[NOTE: Self-contained, minimal reproducing code samples are extremely helpful and will expedite addressing your issue]

  1. Prepare a simple notebook: image

  2. Run the cell and type something in the cell before cell runs done: image

  3. Click the cell to make sure the cell has been focused: image

  4. Ctrl + Z, Outputs disappeared. image

  5. Ctrl + Z, Code undo. image

Logs

Not important

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
IanMatthewHuffcommented, Apr 28, 2021

I don’t believe there is a current workaround on this. We can discuss at our triage meeting (Thursday) about what we’d expect Ctrl-Z to do in this situation. If we have agreement from our team on this change I could help point you are the code area for making this fix. Our focus is really heavily on the new UI currently, so we’d be unlikely to fix it ourselves.

0reactions
Kingwlcommented, Jun 2, 2021

Thanks to the team!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Jupyter lab: ctrl + z shortcut only for selected cell rather than ...
I'm adding a picture to illustrate how to disable document-wide undo/redo here. JupyterLab -> Settings -> Advanced Settings Editor -> Notebook ...
Read more >
Jupyter Notebook - Editing - Tutorialspoint
Ctrl-[. dedent. Ctrl-Down. go to cell end ; Ctrl-A. select all. Ctrl-Left. go one word left ; Ctrl-Z. undo. Ctrl-Right. go one word...
Read more >
10 tricks for a better Google Colab experience
1. SAVE TIME WITH KEYBOARD SHORTCUTS ; Undo last action (inside a cell): ctrl + m + z ; Find and replace: ctrl...
Read more >
JupyterLab Changelog — JupyterLab 3.6.0b0 documentation
The undo/redo history in the notebook is now document-wide (tracking changes across all cells); the future verisions will enable restoring the previous ...
Read more >
Working with Jupyter Notebooks in Visual Studio Code
You can use the z key to undo your previous change, for example, if you've made an accidental edit, you can undo it...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found