code cell with syntax error gets erased on toggle
namin opened this issue · comments
Steps to reproduce:
- Create a code cell.
- Write invalid code, such as:
1, 2, 3
. The code block is highlighted in orange. - Click the down arrow to toggle the visibility of the code block, rendering it not visible.
- Click the right arrow to toggle visibility of the code block, rendering it visible.
- The code block is empty, while expected to contain
1, 2, 3
.
Hi, I believe the confusion here is the orange color. Actually, the orange highlight is not a syntax error - it simply means that the code was changed and not yet saved / run. You need to run a code cell with Shift+Enter before it is saved. See the two images below, before and after pressing Shift+Enter.
However, I agree that it is not desirable behavior for the editor's contents to be reset when the code visibility gets toggled.