-
Notifications
You must be signed in to change notification settings - Fork 31
Description
Extension version
2.4.0
Issue description
When using interpolation in renpy.random.choice or simply using a left bracket, the syntax highlighting breaks, resulting in the following code all taking the color used for strings instead of their proper syntax colors. I have provided screenshots and code to help visualize this issue.
Scope inspector screenshots
(A screenshot to demonstrate the correct syntax highlighting of a comment before it is broken.)

(A screenshot to demonstrate the breaking of syntax highlighting on the same comment when interpolation in renpy.random.choice([]) is used.)

(A screenshot to demonstrate that this issue remains even if interpolation is done more than once.)

(A screenshot to demonstrate that the syntax highlighting is primarily being broken by the left square bracket.)

(A screenshot to demonstrate that syntax highlighting isn't being broken by the right square bracket.)

Code
`
label start:
# Syntax highlighting works as normal.
$narrator(renpy.random.choice(["This is fine."]))
$Name = "Alpha Fenrir"
# Introduce data interpolation, even once, or square brackets and the syntax highlighting breaks.
#$narrator(renpy.random.choice(["Hello, I'm [Name]."]))
#$narrator(renpy.random.choice(["Hello, I'm [Name].", "Nice to meet you, I'm [Name]."]))
# It seems to be primarily broken by the left bracket ([).
#$narrator(renpy.random.choice(["["]))
# Right brackets don't break syntax highlighting.
#$narrator(renpy.random.choice(["]"]))
# This comment should be green and the return statement below should be purple, if they're orange something's wrong.
return
`