Add commands that IDEal Auto-indents

Blitz3D Forums/Blitz3D Beginners Area/Add commands that IDEal Auto-indents

Rob the Great(Posted 2011) [#1]
I like the autoindent function in IDEal, but the problem I'm running into is that I can't get certain lines to stay indented with this feature on. For example:
;This is from the FastImage library
StartDraw
      DrawImagePart(image,0,0,100,100)
EndDraw

always changes to:
;This is from the FastImage library
StartDraw
DrawImagePart(image,0,0,100,100)
EndDraw

When I go to add a tab at the beginning of DrawImagePart, it works until I move to another line, in which it removes the tab. I can get it to stay if I mess with it long enough, but as soon as I go to change, add, or remove code in that block, it removes the tabs in that whole section.

So, my question is: how can I easily get around that? Is there some way to add "StartDraw" and "EndDraw" as custom tabbing blocks? Or, can I get IDEal to ignore automatic tabbing on certain lines? If none of these are possible, a work-around I've been doing is setting the auto-indent to simple, coding those blocks, and then changing it back to advanced, but it's a little time consuming to do it that way.


pc_tek(Posted 2011) [#2]
Change the 'Autoindent Mode' to simple.


Rob the Great(Posted 2011) [#3]
Sounds good. I was thinking that would be the only easy solution, but it didn't hurt to ask.


Adam Novagen(Posted 2011) [#4]
Yeah I've never liked the "intelligent" audo-indenting, just messes me up too much. Plus, I learned to code from Maneesh Sethi's Game Programming for Teens, which means I'm one of those oddballs that indents everything EXCEPT the contents of functions, i.e.:

While Not KeyHit(1)
    Cls
    DoStuff()
    Flip
Wend


Function DoStuff()

If KeyDown(203)
    If KeyDown(208)
        x = x + 1
    EndIf
EndIf

End Function

Most, as far as I'm aware, would have the entire contents of DoStuff() indented one tab-width, but not me. Dunno why, it just looks weird to me. When I dabble in C++, however, I indent function contents like everything else; go figure!


_PJ_(Posted 2011) [#5]
Yeah, I#m one who likes function contents indented, such as:
Function DoStuff(X)
    Local Var=X+1
    If (Var>10)
        Var=0
    Else
        If (Millisecs()<0)
            Var=5
        Else
            Var=3
        End If
    End If
    Print Var
End Function


One thing that I personally don't like, but seems very standardised for a lot of folks, is, when it comes to C etc., leaving braces on the end of the line... to me it's harder to spot and doesn't look right! (Though I'm sure I'm in a minority!)
int SomeFunction(int x){
x++;
return x;
}


Personally, I would prefer this:
int SomeFunction(int x)
   {
      x++;
      return x;
   }



Adam Novagen(Posted 2011) [#6]
That second option does look a lot better, but personally I use the former simply as a hangover from Blitz. When I do that, I think of "{" as "Function" and "}" as "End Function." 'S weird. XD


Blitzplotter(Posted 2011) [#7]
Thanks for the switch to simple mode, i love ideal but the indents can be a bit mad.