Pluto.jl: CodeMirror 0.50.2 bug

Created on 11 Apr 2020  ·  4Comments  ·  Source: fonsp/Pluto.jl

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.

almost closed

Most helpful comment

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

All 4 comments

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

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.

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

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).

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fonsp picture fonsp  ·  4Comments

fonsp picture fonsp  ·  5Comments

MikaelSlevinsky picture MikaelSlevinsky  ·  5Comments

fonsp picture fonsp  ·  5Comments

roflmaostc picture roflmaostc  ·  4Comments