Feature request: BSD style braces

Started by Kweepa, Tue 27/07/2004 03:28:32

Previous topic - Next topic

Kweepa

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
Still waiting for Purity of the Surf II

Lazy Hollister Man

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.

Kweepa

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...
Still waiting for Purity of the Surf II

Radiant

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.

Scorpiorus

#4
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;
*/


Kweepa

Scorpiorus,
Oh yes, I remember you mentioning this before.
Thanks again!
Steve
Still waiting for Purity of the Surf II

Pumaman

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.

Ishmael

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?
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

Kweepa

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...
Still waiting for Purity of the Surf II

Ishmael

I'd say look for AJA's ScriptEditor's new version, not sure though... if he ís still working on it...
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

SMF spam blocked by CleanTalk