Make tabs display properly in TextObjects

Tl;Dr:

Tabs are smaller than or equal to a single space when displayed in a Roblox TextObject.
That’s bad behavior. Please fix.


Within a TextBox/Label/Button, "\t" is displayed smaller than or equal to a " ".

This means that any attempt at displaying indented text does not work.


SourceSans:

image

Code:
image

Arial:
image

Gotham:
image

Why is tab smaller than space?


I know some people will say to just do global substitution to multiple spaces:

TextBox:GetPropertyChangedSignal("Text"):Connect(function()
	TextBox.Text = string.gsub(TextBox.Text, "\t", "    ")
end)

This is flawed.
Not only will this mess up the user’s CursorPosition every time they indent, but it means that if they want to traverse it via the arrow keys or to backspace it, it becomes 4 key presses instead of 1.

Currently, I use global substitution but manually move the CursorPosition based on changes I make. I still have to work out exactly to solve the 4:1 keypress issue. Or…

Roblox should handle tabs properly, and we shouldn’t be forced to sacrifice UX, CPU, and development time for such a basic feature.


Back in 2015, @TheNexusAvenger made this very short feature request that says the opposite. This implies that, once upon a time, Roblox actually did allow tabs. We should go back to that, rather than remove core functionality from a vague 2 sentence request. (No hate to Nexus tho <3)

36 Likes

I’m working on a simple IDE for my console language and I’m somewhat stuck because of this. Nexus’s feature request is more of a result of incompetence (sorry :c) as they could have easily fixed the spam issue by limiting how many lines and width a message can take up.

3 Likes

Bumping this topic because it’s currently causing such a headache as I do more work on my in-game IDE. This behavior is so counter-intuitive and leads to wasted resources and developer time.

10 Likes

I would like to bump this as it’s preventing my plugins from having code that can easily be copied and pasted. This is very annoying for my own productivity.

3 Likes