• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Suggestion Auto Tab scripts in code tags.

Xikini

I whore myself out for likes
Senator
Premium User
Joined
Nov 17, 2010
Messages
6,756
Solutions
578
Reaction score
5,305
Would it be difficult to auto-tab scripts placed in code tags?
I think it would be useful, as I often find people posting 'tabbed with spacebar' & 'I have no idea how to tab', which basically makes the code unreadable, until you copy paste the 10-2000 lines of script, and manually tab it yourself, so you can even start looking at the code.

TL : DR - Can scripts be auto-tabbed by the system, before it's posted to the boards?
 
Would it be difficult to auto-tab scripts placed in code tags?
I think it would be useful, as I often find people posting 'tabbed with spacebar' & 'I have no idea how to tab', which basically makes the code unreadable, until you copy paste the 10-2000 lines of script, and manually tab it yourself, so you can even start looking at the code.

TL : DR - Can scripts be auto-tabbed by the system, before it's posted to the boards?

There are ways to "auto" tab scripts, but you saying "spaces" Xenforo seems to replace tabs with spaces (unlike VB that we used before)
I can't find any plugins for Xenforo to auto tab scripts so someone would probbly have to write one for the forum.

But then again ppl might tab things in a certain way to help you see the problem (ex adding an extra tab) while that program would remove that tab.
If this was to be added there should be a check to see if the script is already tabbed.
 
There are ways to "auto" tab scripts, but you saying "spaces" Xenforo seems to replace tabs with spaces (unlike VB that we used before)
I can't find any plugins for Xenforo to auto tab scripts so someone would probbly have to write one for the forum.

But then again ppl might tab things in a certain way to help you see the problem (ex adding an extra tab) while that program would remove that tab.
If this was to be added there should be a check to see if the script is already tabbed.
I meant, people tab their scripts with space, then copy paste in here, and the system removes the spaces which basically makes a long wall of text. xD

But yeah, fringe cases should have an exclusion check of some sort.

But my complaint is looking at these two types of tabbing
Lua - Exhaust (cooldown) on this spell
talkaction !buytools Proplem with script

Whether or not the tabbing error's are accidental or copy-paste errors..
I feel that if a system auto-tabs the scripts to always follow 'proper tabbing', we will at the very least, always be looking at the same tabbing each time we happen upon a post with code tags.

Functional harmony & chaos. xD
 
Maybe we could somehow check the "tabs" in code tag and then refuse to add the script if its not tabbed.
 
I meant, people tab their scripts with space, then copy paste in here, and the system removes the spaces which basically makes a long wall of text. xD

But yeah, fringe cases should have an exclusion check of some sort.

But my complaint is looking at these two types of tabbing
Lua - Exhaust (cooldown) on this spell
talkaction !buytools Proplem with script

Whether or not the tabbing error's are accidental or copy-paste errors..
I feel that if a system auto-tabs the scripts to always follow 'proper tabbing', we will at the very least, always be looking at the same tabbing each time we happen upon a post with code tags.

Functional harmony & chaos. xD

Well in that case I fully support this :p

Maybe we could somehow check the "tabs" in code tag and then refuse to add the script if its not tabbed.

Seeing as ppl can't read read rules (even if you warn them 10000 times) I doubt they would understand to tab the scripts xD
 
Whether you use spaces or tabs is a matter of convention. All projects I work on actually use 4 spaces for indentation, never tabs. That seems to be a recent trend. That's because a space is always the same length and a tab differs in screen-size based on the "viewer".

Also, I doubt we will ever get a truly powerful code highlighter that has all the features we use/need. I would prefer to add an ability to e.g. embed GitHub Gists. However, that has the problem of users editing/removing them if they are used in Downloads possibly including malicious code or rendering the threads obsolete. There is no perfect way I can think of to make it good at the moment. However, XenForo 2 should improve the code highlighter - I think it will not require a plugin.
 
Whether you use spaces or tabs is a matter of convention. All projects I work on actually use 4 spaces for indentation, never tabs. That seems to be a recent trend. That's because a space is always the same length and a tab differs in screen-size based on the "viewer".

Also, I doubt we will ever get a truly powerful code highlighter that has all the features we use/need. I would prefer to add an ability to e.g. embed GitHub Gists. However, that has the problem of users editing/removing them if they are used in Downloads possibly including malicious code or rendering the threads obsolete. There is no perfect way I can think of to make it good at the moment. However, XenForo 2 should improve the code highlighter - I think it will not require a plugin.

Well I think thats the reason why (I guess) most users prefer tabs - if they wanna see 2 spaces per tab they can do that, if they wanna see 5/6 they can do that.
But the end game is that everyone can see it as they want without the next guy going crazy over the 2 spaces or w/e

I might be way off but didn't the VB code tags provide tabs "as is"?
Another thing is the "numberd lines" when you copy paste a code from a post to another one, you insted have to paste it into the serach bar or a notepad to get rid of that and in most cases re-tab the script after that.

Hopefully XenForo 2 can help fix those issues tho :p
 
manually tab it yourself
you can literally indent a whole file with 2 key strokes with vim.
on topic, i always use space as Don Daniello said, tabs have not fixed size and bothers a lot when you use multiple editors.
 
you can literally indent a whole file with 2 key strokes with vim.
on topic, i always use space as Don Daniello said, tabs have not fixed size and bothers a lot when you use multiple editors.

Not sure what you ment about the tabs, it's a single character like one space but you can edit the lenght of it in your editor, so the reason why it might look weird to you in another editor is because it uses another setting then what you are used with.

In notepad++ you go to settings -> settings -> tab settings
And in there you can change the lenght of the tab aswell as changing it for certain languages, ex if you want PHP to show 2 spaces per tab and C++ 10 spaces you can do that.
 
Not sure what you ment about the tabs, it's a single character like one space but you can edit the lenght of it in your editor, so the reason why it might look weird to you in another editor is because it uses another setting then what you are used with.

In notepad++ you go to settings -> settings -> tab settings
And in there you can change the lenght of the tab aswell as changing it for certain languages, ex if you want PHP to show 2 spaces per tab and C++ 10 spaces you can do that.
i do only use terminal-like text editors, yes you can change the tab size, but when you need to do that let's say in 100 machines it will be really annoying (and stupid, since you could have used tab are spaces thing), another thing is that you don't always have root access to change/install things, as i said spaces are portable, tabs are not.
 
i do only use terminal-like text editors, yes you can change the tab size, but when you need to do that let's say in 100 machines it will be really annoying (and stupid, since you could have used tab are spaces thing), another thing is that you don't always have root access to change/install things, as i said spaces are portable, tabs are not.

Do you code on 100 machines?
Let's say you prefer tabs, then you have to either replace the 2 or w/e spaces with w/e you prefer insted of always seeing it like you wish.

Well tabs are kinda spaces but kinda not, they are a character just like the letter A that you can change the font size on, insted of always having it at the smallest or largest font.
 
To be clear, this thread isn't about the space key or the tab key, it's about proper identation of scripts inside code tags. :p

Whether you want to use 4 spaces or 1 tab doesn't matter.
I just want to be able to read the code. lol
 
To be clear, this thread isn't about the space key or the tab key, it's about proper identation of scripts inside code tags. :p
sorry about that :oops:, i believe if forum will auto indent thinks that might matter, and for now, i believe any editor can auto indent a file, you don't need to do it manually
Do you code on 100 machines?
Let's say you prefer tabs, then you have to either replace the 2 or w/e spaces with w/e you prefer insted of always seeing it like you wish.

Well tabs are kinda spaces but kinda not, they are a character just like the letter A that you can change the font size on, insted of always having it at the smallest or largest font.
ofc i don't do programming on 100 different machines, if you ever have had any contact with unix-like systems you might noticed that all configurations is done through files, and much more, system automation with bash scripts, daemons, grub scripts, and so on, so you don't use text editors only for programming, about programming itself, it's not every company that gives you a exclusive machine, most of time you're jumping around, so thats why i keep with spaces, and all projects i've worked on, uses spaces either
 
Back
Top