UnBuildJoin Date: 2013-03-22 Post Count: 3233 |
|
|
|
and that, kids, is why you indent your code while you write it |
|
|
(Admittedly, this feature should work better, since unindented code from someone else is bound to be encountered.) |
|
UnBuildJoin Date: 2013-03-22 Post Count: 3233 |
@Awsum
Sometimes it gets indented wrong if you add more to it
Like
while true do
[TAB] wait(1)
[TAB] print("ok")
end
Lets add a if statement
while true do
[TAB] if true then
[TAB] wait(1)
[TAB] print("ok")
[TAB] end
end
Tabs, y u no correct?
(Thats on a small scale, what if wait(1) and print("ok") was a the rest of your script)
Or if you post it on the forums
Or if someone PMs it to you |
|
|
Well, for the first case, you can actually select large portions of code and press Tab to indent the section, so it's not often that hard to do it yourself.
The next two?
Yeah, this needs to be fixed.
Unfortunately, fixing it probably isn't entirely easy. You have to account for a wide range of cases where there should be indenting. Like:
• After a () if function is there before it.
•After then
•After do
•After repeat
•After a ( or { is opened in certain cases
•Increment a tab counter each time any above cases occurs
•Decrement counter if an end is encountered, or if a ) or } closes a special case of braces
•Clear code of tabs before adding the fixed ones in.
Not easy to code in my experience. |
|
cntkillmeJoin Date: 2008-04-07 Post Count: 49450 |
Find and Replace
[TAB]
with
[NOTHING]
CLEARED!!! |
|
UnBuildJoin Date: 2013-03-22 Post Count: 3233 |
@Cnt
...That removes the tabs...
"Well, for the first case, you can actually select large portions of code and press Tab to indent the section, so it's not often that hard to do it yourself."
For me, that just clears the script to a tab |
|
|
Well, that's not supposed to happen.
The Prime Jester of Scripters has spoken. |
|
UnBuildJoin Date: 2013-03-22 Post Count: 3233 |
@Awsum
http://www.youtube.com/watch?v=rNm8q99Qe6A |
|
|
dr01d's plugin automatically fixes this |
|
Dr01d3k4Join Date: 2007-10-11 Post Count: 17916 |
^
Though it doesn't work with else(if) I believe. I would love to make a full formatter that takes your code, splits it into the tokens and reconstructs it with tabs, spaces, newlines etc. |
|
coploxJoin Date: 2008-06-07 Post Count: 3252 |
|
|
1waffle1Join Date: 2007-10-16 Post Count: 16381 |
your code is ugly.
use forum enhancer. |
|
UnBuildJoin Date: 2013-03-22 Post Count: 3233 |
"Your code is ugly" I didn't post any... |
|