Yellow 'end' symbol + no colors in Atom

Hi,

I have two problem, but they might be connected. When I use Julia in Atom, the symbols are no longer colored when the line becomes too long. Any idea why?
Also, sometimes I break a line and all the ‘end’ symbols in loops become yellow.

Looking forward for some help.
Thanks

When I use Julia in Atom, the symbols are no longer colored when the line becomes too long.

I think Juno just stops parsing the line if it gets too long. For me that happens at ~400 characters, and maybe then the best idea would be to split the line. 80-100 characters per line is usually preferred for readability.

Also, sometimes I break a line and all the ‘end’ symbols in loops become yellow.

Hm, that’s hard to tell because I don’t know what yellow “means” in your color syntax and what color it should be instead. It would be helpful if you could provide a little snippet where that happens or maybe a screenshot if that helps with the colors.
One idea I have is that there is some problem with strings that are “open”, as in

for a in "
    a
end

but then everything after " is detected as a string.

1 Like

Thank you!
Does “stop parsins” mean it does not read the code? The code was still giving me sensible results, and in fact sometimes the code was ‘losing color’ in the middle of a line, so I would have imagined Julia giving me an error in that case. I changed to 400 characters now.

On the second part, here is an example. This code looks normal

It’s a vector that is built stacking up two other vectors (divided by the ; at the end of the first line). If I break the first line, see what happens to ‘end’

But if then I delete a random piece of the second line, I do not see any problem again

This is just some code copied and pasted in an empty file. When placed into its file, the code would run even with the yellow end, but it produce different results.

Yeah, what’s happening here is that Atom stops highlighting long lines (should be fine to keep it at ~100 chars), and if that happens in an indexing expression we might erroneously highlight the next end as a in x[end] (which is orange with your theme).
Julia doesn’t care at all about line length, so the only thing that might change is Juno’s block evaluation.

I am not sure what exactly x[end] means (can end be an argument of the vector?). In any case, Julia does not care, but it changes Juno’s block evaluation. Concretely, does it mean that breaking or not the line could change the outcome?

x[end] means the last item of x, so if x = [1, 2, 3], x[end] == 3 and x[end - 1] == 2.

In a quick test I did it still evaluated everything properly, but I can’t promise that’s going to be the case every time. Is there any reason why you prefer such long lines? (Although in this case, while long, it doesn’t seem overly long… maybe the limit can be bumped up.)