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

CodeMirror 0.50.2 bug #72

Closed
karlwessel opened this issue Apr 11, 2020 · 4 comments
Closed

CodeMirror 0.50.2 bug #72

karlwessel opened this issue Apr 11, 2020 · 4 comments

Comments

@karlwessel
Copy link
Contributor

karlwessel commented Apr 11, 2020

This is a strange one...

When I have the following notebook (which is not the real code but a meaningless MWE):

### A Pluto.jl notebook ###
# v0.5.20
# ╔═╡ ff8b2572-7bbb-11ea-3513-175ab56e1fd7
x = [1,2]

# ╔═╡ 0ffef548-7bba-11ea-3b0c-511048e9d2f4
[(x[2])]

# ╔═╡ Cell order:
# ○ ff8b2572-7bbb-11ea-3513-175ab56e1fd7
# ○ 0ffef548-7bba-11ea-3b0c-511048e9d2f4

and in the second cell try to delete the [ between the x and the 2 in [(x[2])] the browser tab hangs. Always.

The first cell actually doesn't matter. The same also happens if the notebook only contains the second cell. I only added it to demonstrate that the code is ok.

The bracket combination in the second cell seems to actually matter somewhat. At least I wasn't able to remove any of them to reduce the MWE further.

Although this might seem like a corner case, it actually happened more than once now for me while working with actual notebooks.

This happens with Chromium and Firefox.

@karlwessel karlwessel changed the title Chromium tab hangs when editing certain code Browser tab hangs when editing certain code Apr 11, 2020
@fonsp
Copy link
Owner

fonsp commented Apr 11, 2020

I'll look into this right now! Thanks for the MWE - breaks for me too.

@fonsp
Copy link
Owner

fonsp commented Apr 11, 2020

Unfortunately the problem is in the CodeMirror formatter (it also breaks in a standalone editor), I'll try to fix it and send them a PR.

It looks like the problem is having a pair round brackets intersect a pair of square brackets, i.e.

(...[...)...]

@fonsp
Copy link
Owner

fonsp commented Apr 11, 2020

I've submitted an Issue with CodeMirror and downgraded CodeMirror to 5.50.0 as a temporary fix (in the upcoming Pluto 0.5.21).

@fonsp fonsp changed the title Browser tab hangs when editing certain code CodeMirror 0 Apr 11, 2020
@fonsp fonsp changed the title CodeMirror 0 CodeMirror 0.50.2 bug Apr 11, 2020
@fonsp
Copy link
Owner

fonsp commented Apr 11, 2020

Marijn fixed the CodeMirror bug! Will be fixed here when CodeMirror releases their next version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants