Explanation
When multiline code is copied into the Command bar, it runs as it would in a script, with any comments only affecting the particular line that is commented out.
However, this replication does not extend to the syntax highlighting. If there is a comment in the pasted code, anything after that is visually shown as a comment, even if they aren’t actually commented.
Expected Result:
(There’s a new line between Comment
and local
)
Actual Result:
Reproduction
- Copy into the command bar any multiline code containing a comment.
- Run the code and see that it runs as expected, with only the actual comment not running.
- Observe that the syntax highlighting shows everything after the comment as a comment
A small snippet of code to test this is:
-- Amazing Comment
local Var = "Hello World"
warn(Var)
Alternatively, this code can be used to show it only affects after the comment:
local ReplicatedStorage = game.ReplicatedStorage
-- Amazing Comment
local Var = "Hello World"
warn(Var)
Device Info
Operating System: Windows 10
CPU: Ryzen 5 3600
GPU: GTX 1650 Super
RAM: 16GB @ 3600MHz