Script indexing table in index does not respect indents

Recent Bug Report – Scripting


Overview
This bug is not a large issue, but is quite annoying for my part of scripting. Where I would be using a table for storing some names of the objects. Then, I’d find the object by getting the name from the table into the index of some object.

So I was scripting during the day(today) and I encountered this issue, where the script does not respect the index in index. For instance this line: workspace[someTable[1]].

The issue is reproducible at 100% of the time.

How To Reproduce
Write some code with indents. Examples found below. After that line is written, press return(or enter), which then removes the previous indent.

Take this one for instance:

do
    someObject[t[i]]
end

…which then turns into…

do
someObject[t[i]] -- pressed return here

end

Expected behavior would be:

do
    someObject[t[i]] -- pressed return here
    -- indent stays here
end

Analysis of Impact
Apparently, the “auto-correct” mistakes it for a block of string, thus removing the previous indent.

The impact of the bug would be writing, only halting a few seconds trying to fix the indent of code again.

3 Likes

Can repro, I was working on a rhythm game and this happened to me when I pressed return.

Indentation is still a problem? New mutations of this bug keep popping up or I’m just seeing repeat threads, I don’t know anymore.

The only indentation issues I’m still experiencing is if a scope opening keyword is used outside of “code” (in a string, in a comment, etc). Not sure if I can reproduce this or I just haven’t stumbled across it yet.