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

Syntax highlighting error involving range and macro #2063

Closed
chunjiw opened this issue Apr 26, 2022 · 2 comments · Fixed by #2980
Closed

Syntax highlighting error involving range and macro #2063

chunjiw opened this issue Apr 26, 2022 · 2 comments · Fixed by #2980
Labels
bug Something isn't working CM6 CodeMirror 6

Comments

@chunjiw
Copy link

chunjiw commented Apr 26, 2022

This code

@amacro begin
    x = a : b:c
end

renders like
image

I'm using Pluto 0.19.0, Julia 1.7.2

@chunjiw
Copy link
Author

chunjiw commented Apr 26, 2022

Another minimal example:
image

@fonsp fonsp added bug Something isn't working CM6 CodeMirror 6 labels Apr 27, 2022
@ForceBru
Copy link

Same thing with a, = (b) syntax:

@time let
	for i in 1:5
		x, = (2)
	end
end

Looks like this, with end keywords not highlighted:

bug

end become correctly highlighted when parentheses in (2) are removed:

@time let
	for i in 1:5
		x, = 2
	end
end

x, = fn(2)

Only the last end keyword will be mis-highlighted when this syntax is used:

@time let
	for i in 1:5
		x, = fn(2)
	end
end

bug2

Without range syntax

Try this code (indentation is important!):

@time let
	for i in [1,2]
	x, = (2)
	end
end

This is highlighted like this:

bug3

Now place the cursor before the innermost end and press Backspace. Pluto will suddenly recognize this weirdly aligned end as belonging to for and highlight it correctly:

bug4

Versions

  • Pluto v0.19.25
  • Julia v1.9.0

@fonsp fonsp linked a pull request Jan 17, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working CM6 CodeMirror 6
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants