Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Kweepa on Tue 27/07/2004 03:28:32

Title: Feature request: BSD style braces
Post by: Kweepa on Tue 27/07/2004 03:28:32
In K&R and BSD coding styles, the closing brace is a tab stop left of the enclosed code block, eg

if (PlayerIsFreeOfGoo())
{
  ReleaseCustard();
}

rather than

if (SwordmasterHasBunion())
{
  TicklePostman();
  }

Could we have an option for the code editor to work that way?
I spend a lot of time reformatting...

Thanks in advance,
Steve
Title: Re: Feature request: BSD style braces
Post by: on Tue 27/07/2004 05:24:26
I agree!  I've been coding like that since my days programming LOGO in elementary school.  My AGS code is messy because I can't get used to the way AGS does it automatically.

I know RickJ had mentioned the idea of making a new 'flavor' of the Scintilla engine (used for the Script Editor) that would do things like that.  I noticed that you can select several lines and press TAB to tab them ALL in at once.  Unforunately, the tab stops are way too big.  We wanted to try changing that, as well. I am not very good, nor do I have the time to do it, but I thought I'd mention it.
Title: Re: Feature request: BSD style braces
Post by: Kweepa on Tue 27/07/2004 05:57:02
Oh well then... here's my wish list:

I'd like smaller tab stops too.
And Shift-TAB to move a block back a tab stop - oh, that works already! Woo!
Maybe we could have F5 as an alternative to Ctrl+T - I write code for a living, and frequently press Ctrl+T at work to run the game, or F5 at home :)

The biggies:

Multiple scripts open at once.
Parsing the #defines and having the symbols in the autocomplete list.

I may have mentioned some of these before...
Title: Re: Feature request: BSD style braces
Post by: Radiant on Wed 28/07/2004 15:11:59
Second!

Also search/replace, and the 'start from current position' flag being /saved/ when you close and re-open the editor, and preferably the cursor position as well if that's possible.
Title: Re: Feature request: BSD style braces
Post by: Scorpiorus on Wed 28/07/2004 23:31:45
I think the tab is about eight symbols. I would too like either an option to change it or set it at least to 4.

Quote from: SteveMcCrea on Tue 27/07/2004 05:57:02Parsing the #defines and having the symbols in the autocomplete list.
What I currently do when want to have extra words to be autocompleted:

#define AGS_CHARACTERS_MAX 150

int aVeryLongVariable;

script header:

/*
import int aVeryLongVariable;
import int AGS_CHARACTERS_MAX;
*/
Title: Re: Feature request: BSD style braces
Post by: Kweepa on Thu 29/07/2004 00:23:54
Scorpiorus,
Oh yes, I remember you mentioning this before.
Thanks again!
Steve
Title: Re: Feature request: BSD style braces
Post by: Pumaman on Sun 01/08/2004 03:21:39
In terms of the original request -- the reason for this is simply that AGS is lazy -- it indents the opening brace but doesn't bother checking for and de-denting closing braces.

It probably should, I agree, because scripts can look messy. Perhaps another solution would be a "reformat script" option that would take the whole script and lay it out accoding to BSD style.

On the other hand, because AGS does support using an external text editor, this sort of thing is always low priority because it's possible to use another one.
Title: Re: Feature request: BSD style braces
Post by: Ishmael on Sun 01/08/2004 12:38:34
I do it that way... well almost

if (IsBlahBlahOrBleh) {
  //codeh
} // <--- I put this here with two backspaces

Or did I just miss the whole point?
Title: Re: Feature request: BSD style braces
Post by: Kweepa on Sun 01/08/2004 18:38:23
We could use an external editor, but then we'd miss out on all the lovely autocompletion stuff!
Unless there's some way to get our hands on the autocompletion info?
Cheers...
Title: Re: Feature request: BSD style braces
Post by: Ishmael on Mon 02/08/2004 07:51:58
I'd say look for AJA's ScriptEditor's new version, not sure though... if he ís still working on it...