Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

String interpolation + printf format string = confused syntax highlighter and garbled, uneditable cell #6128

Closed
bzinberg opened this issue Jan 30, 2020 · 1 comment

Comments

@bzinberg
Copy link

Redirected from JuliaLang/IJulia.jl#896:

Steps to reproduce:

virtualenv -p python3 repro_jupyter_printf
source repro_jupyter_printf/bin/activate
pip install jupyter
cd repro_jupyter_printf
JULIA_PROJECT=. julia -e 'import Pkg; Pkg.add("IJulia")'
JULIA_PROJECT=. jupyter notebook

Then in the Jupyter frontend, create a new Julia notebook, and in the first cell (a code cell), type these characters:

"$(@sprintf("%04

The 4 is not displayed, and the frontend gets confused. From that point on the cell looks not editable (in Firefox, no cursor), and trying to type new text in the cell results in the text disappearing and sometimes reappearing. Also, the cell loses all syntax highlighting. This behavior for the offending cell persists across page reloads. Editing other cells or creating new cells still works.

I'm guessing the syntax highlighter is getting confused.

@marijnh
Copy link
Member

marijnh commented Jan 30, 2020

The Julia mode doesn't seem to crash on this input, but this does sound like issue #6064, which was fixed two months ago. So see if you can get Jupyter to update that code (specifically mode/julia/julia.js). If that doesn't help, feel free to reopen.

@marijnh marijnh closed this as completed Jan 30, 2020
bzinberg added a commit to bzinberg/notebook that referenced this issue Jan 30, 2020
Per codemirror/codemirror5#6128 (comment), hoping to pick up a fix to codemirror/codemirror5#6064 that got merged in recently.
echarles pushed a commit to datalayer-externals/jupyter-notebook-classic that referenced this issue Apr 28, 2022
Per codemirror/codemirror5#6128 (comment), hoping to pick up a fix to codemirror/codemirror5#6064 that got merged in recently.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants