Long comment/string highlighting issue

Description of bug:

When changing the level* of long comments or long strings, subsequent code is incorrectly highlighted as comment or string respectively. This happens regardless of how many levels you add or remove, as long as it is a different level than it was at when the script was opened.

*) amount of “=” characters between the [[ and ]], i.e.

-- [[ long comment ]]
-- [==[ long comment of level 2, so that i can put ]] safely in the comment ]==]

local s1 = [[ long string ]]
local s2 = [====[ same concept, long string of level 4 ]====]

Depiction of problem:

LongHighlight2.gif

After I add ‘=’ to the front and back of the long comment definition, it should not be highlighting the code below it on line 7 in comment color.

LongHighlight1.gif

After I add ‘==’ to the front and back of the string definition, it should not be highlighting the code below it on line 7 in string color.

Additional notes:

  • Reloading the script fixes the highlighting into what it is expected to do. However, if you change the level of the comment/string again (adding/removing "="s), the highlighting is messed up until you reload the script once more.
  • When creating a new long comment / string in a script, the highlighting is correct until you start adding levels (adding '='s).
4 Likes

Oh, they still didn’t fix that? This must’ve been reported at least twice or so here over the years.

3 Likes
--[==[
asdf
--]==]
qwerty

qwerty is green in studio

1 Like

Not able to replicate
image

Edit: Windows 10 not in team create. Also tried in a TC and it still did not have qwerty as commented

1 Like

image

I have FFlagStudioAutocompleteImprovementsV2 disabled. It might be related but I doubt it.

I’m on windows 10 in team create

What the heck, I think you’re onto something

I did that at first then it worked fine, but when I switched it to just the --[[

and NOW it’s broken. Apparently if you start it in one style, and then switch to the other without completely erasing all the text to the --'s, it will glitch

here it is broken your way


fixed my way

fixed your way

Can confirm @ColdSmoke’s findings that this only happens when the =s are changed. If the code is pasted, the syntax coloring is fine, but when an = is removed or added, the bug occurs.

https://gfycat.com/SmoggyMenacingAquaticleech

As far as I can tell, it’s also only if it’s the ]==] part that’s changed first. I’ve added this to our bug list.

3 Likes

This just happened to me… I’m surprised such an old bug is still happening

2 Likes