Treat tabs as spaces when pasting code in the forum

E.g. I just pasted this from Godot where I copied and pasted a section of code with tabs. Note the vertical lines in the code.

||var xx:=Utils.new()|
|---|---|
||xx.gnome_convos += 1|
||xx.player_current_attack = true|
||xx.somefunc(xx.gnome_convos)|

However this same code is spaced correctly, because I added a non tabbed line at the start

func _ready():
	var xx:=Utils.new()
	xx.gnome_convos += 1
	xx.player_current_attack = true
	xx.somefunc(xx.gnome_convos)

I don’t think we should change any user input automatically. We can’t know if a posted text is GDScript or something else, so we would have false positives where we convert characters that shouldn’t be converted. Also I’m not entirely sure why you want that, both tabs and spaces are valid and just a matter of preference

So why do tabs and LFs show as vertical lines? Am I missing something? Is it my settings on the forum?

Wait, they actually are pasted as vertical lines for you? I thought you just replaced tabs with vertical lines to make them visible in order to demonstrate your code.

Just as a test, this is some pasted code with tabs for me:

func test():
	print("hello world")

Ahhh I see, it only happens if the first character is a tab character because the forum thinks of that as a table. I deactivated this feature, I don’t think the forum should change any text that users paste.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.