ekzhang / percival

📝 Web-based, reactive Datalog notebooks for data analysis and visualization

Home Page:https://percival.ink

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

code cell with syntax error gets erased on toggle

namin opened this issue · comments

Steps to reproduce:

  1. Create a code cell.
  2. Write invalid code, such as: 1, 2, 3. The code block is highlighted in orange.
  3. Click the down arrow to toggle the visibility of the code block, rendering it not visible.
  4. Click the right arrow to toggle visibility of the code block, rendering it visible.
  5. 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.

image

image

However, I agree that it is not desirable behavior for the editor's contents to be reset when the code visibility gets toggled.