Ability to use tab key in post

As a DevForum member offering scripting support on the forum, it is currently very consuming create new code and/or edit existing code because of the lack of ability to use the tab key.

If Roblox is able to address this issue, it would improve my experience using the forum because the amount of total time saved would be astronomical.

Justifications for this request

Currently, we do not have the ability to use the tab key or the ability to create a new indent here on the forum. The closest thing we have is copy and pasting from studio or using 4 spaces which, in turn, means we have to spend 4x the amount of time creating new indentations (and then more to check if the 4 spaces are aligned correctly).

What makes this worse is that sometimes copying code from Studio doesn’t format into the forum properly.

Example, here’s some code that does absolutely nothing.

Sometimes it gets pasted to this monstrosity:

local runService = game:GetService(

'RunService'

)

local function posts()

local string = ''

local function post()

return 'post'

end

string ..= post()..' with indents'

end

print(

'this is a cool',

posts()

)

if true then

if true then

for i = 1,10 do

local myVar = 'ok'

end

end

end

It wouldn’t be so bad to fix it if we were able to do it with the ability to create indents, but sometimes posts are created like this.

Next thing is creating new code.

Sometimes I want to provide some help on the forum by creating new code to give to someone to try out. Problem is that this takes a long time, especially if there is supposed to be multiple levels of indentations.

Here’s another useless block of code. Note the print. It takes 20 spaces per indent on the innermost part.

while true do
    if true then
        if not false then
            if '' then
                print(
                    tostring(123),
                    tostring(nil),
                    tostring({}),
                 )
             end
        end
    end
end

Now, for an actual useful example, if we want to do something with math. Let’s say creating a new CFrame relative to an initial CFrame.

We have 2 options:

Option 1 is more organized and readable:

local oldCFrame = CFrame.new()

local newCFrame = oldCFrame * CFrame.Angles(
    math.floor(
        math.random() * 100
    ),
    math.floor(
        math.random() * 100
    ),
    math.floor(
        math.random() * 100
    )
)

But if we want to evade using the indents because it takes 4x as long to write the indents, we’re left with this behemoth of a line:

local oldCFrame = CFrame.new()

local newCFrame = oldCFrame * CFrame.Angles(math.floor(math.random() * 100), math.floor(math.random() * 100), math.floor(math.random() * 100))

Not only is it ugly and hard to read, it’s also inconvenient for debugging.

Anyway, you may be thinking, “This post is useless”. And at first glance, you might think so. But keep in mind that, if you’re a frequent forum user like I am, you may have hundreds of posts containing code which uses multiple indents.

Let’s say I have 500 posts, each of which contains an average of 10 lines which have an average of 1 indent. Let’s say it takes us 1 second to type these 4 spaces for the sake of simplicity.

100 posts x 40 spaces = 20000 spaces.
20000 spaces Ă· 4 = 5000 seconds

83 minutes and 20 seconds.
This could have been reduced to a little under 21 minutes if the ability to create these indents existed.

Anyway, that concludes my feature request. Thanks for taking the time to read and consider.

6 Likes

Unfortunately this is not possible on a forum level as Tab is a different shortcut in discourse.

You could request it at discourse meta however!

1 Like

Ah I see.

Do you think it would be possible to create another shortcut to create these tabs like alt + tab or something, or is this just out of any realm of possibility? Not too sure what is and isn’t possible on here haha.

It might be possible? I’m no discourse expert here but I can tell you that a feature like that would have to be created on the discourse-level, so feel free to suggest it on the meta forum!

1 Like

Stuff like alt+tab (switch windows) and ctrl+tab (switch tabs) is already being used by stuff beyond Discourse’s control, as explained in the topic linked earlier.

2 Likes

I would like to see something like this, but as you know discourse already has this as a key but maybe something simple as “control - tab” might be a option?!

1 Like