Page 1 of 1

Indenting a block of code in script editor

PostPosted: Fri Aug 13, 2010 11:32 am
by jasantana
Servoy IDE could be enhanced if we had an option in the Script Editor to indent a block of code.

For example if after writing a block of code I see that I need to place an IF condition I can indent that block just selecting and indenting it.

Thanks.

Re: Indenting a block of code in script editor

PostPosted: Fri Aug 13, 2010 11:38 am
by jcompagner
select and then press TAB (or Shift TAB the other way) doesn't work for you?

Re: Indenting a block of code in script editor

PostPosted: Fri Aug 13, 2010 12:09 pm
by Vaj
Like Johan said you should be able to use TAB. if not select the block of code and do [ CTRL + SHIFT + F ] this automatically formats the code for you. You can optionally define how you want to format the code by going in to Window --> Preferences --> JavaScript --> Formatter. Makes life much easier! :)

Re: Indenting a block of code in script editor

PostPosted: Fri Aug 13, 2010 1:01 pm
by jasantana
Ups!! Sorry friends thats correct. I did not know that tricky, I´m new to Servoy and coming from VFP so sometimes I try to do things as I use to.

Thanks and sorry again.

Re: Indenting a block of code in script editor

PostPosted: Fri Aug 13, 2010 1:43 pm
by Joas
jasantana wrote:Ups!! Sorry friends thats correct. I did not know that tricky, I´m new to Servoy and coming from VFP so sometimes I try to do things as I use to.

Thanks and sorry again.

Also try "Ctrl+i" when you have selected a block of code. It will add the right indentation for nested statements as well.
The functionality of "Ctrl+i" is about in the middle between doing just "Tab" and doing "Ctrl+Shift+f". :)