• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Question - IDE Autoindent in code editor

B

Barns

Guest
Newbie here so be gentle. I've just started coding up my first test game, in GM2, and was looking for a way to enable autoindent in the code editor. I googled, came across https://docs.yoyogames.com/source/dadiospice/001_advanced use/preferences/scripts preferences.html which seems to apply to older versions, is there an equivalent in or planned for GM2?

I'm definitely really missing the option from other editors, it's completely hardwired into me to be able to put a brace, enter, and the next line be indented automatically. It doesn't seem like a super tricky option, especially if it was in the previous versions?
 
If it's not there and gets added, I'd like an option for number of spaces to indent, too. It sucks having autoindent use whole tab sized spaces, haha. I like to indent using only a space or two.
 
M

menderleit

Guest
I second this suggestion. Auto-indent is missed. Also auto-closing-bracket would be super nice, so when you type an open curly bracket and press enter it will place a closing bracket and place the cursor in between (auto-indented).

Like this:
if (expression) {
____| <-- cursor
} <- This is placed automatically

_ = Spaces :)
 
S

Scoremonger

Guest
I second this suggestion. Auto-indent is missed. Also auto-closing-bracket would be super nice, so when you type an open curly bracket and press enter it will place a closing bracket and place the cursor in between (auto-indented).

Like this:
if (expression) {
____| <-- cursor
} <- This is placed automatically

_ = Spaces :)
Asking for these two features are the reason I signed up for this forum! I thought this was more or less standard in code editors these days and was a bit surprised to find them missing.
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
Auto-brackets are enabled but only when you use code complete. If you start typing (for example) audio_ then select a function from the autocomplete list, it will add the function and brackets. You could file a suggestion for auto-indent as a bug report.
 

gnysek

Member
@Nocturne, btw., if you already have a bracket after cursor position like d|(), and press ctrl+enter to open completion, then select for example draw_sprite() you will end up with draw_sprite()(), so this is not perfect.
 
S

Scoremonger

Guest
Auto-brackets are enabled but only when you use code complete. If you start typing (for example) audio_ then select a function from the autocomplete list, it will add the function and brackets. You could file a suggestion for auto-indent as a bug report.
@Nocturne Thank you, I've entered a bug requesting optional user-defined auto-indent in the style of Notepad++. Regarding the auto-brackets, I think auto curly braces is really what I'm missing. The free Visual Studio Code editor has a nice implementation of this imo. I realize some people find it annoying, but once you get used to it it's not easy to go back, and it should be something that's easy to disable (or perhaps disabled by default). I went ahead and entered a feature request for that one as well.
 

gnysek

Member
@Nocturne Thank you, I've entered a bug requesting optional user-defined auto-indent in the style of Notepad++. Regarding the auto-brackets, I think auto curly braces is really what I'm missing. The free Visual Studio Code editor has a nice implementation of this imo. I realize some people find it annoying, but once you get used to it it's not easy to go back, and it should be something that's easy to disable (or perhaps disabled by default). I went ahead and entered a feature request for that one as well.
In IntelliJ Idea editors if you enable proper option you can: select the text, press "{" from keyboard, and it will automatically wrap into { ... } and indent selected text. That's even more awesome!
 
S

Scoremonger

Guest
In IntelliJ Idea editors if you enable proper option you can: select the text, press "{" from keyboard, and it will automatically wrap into { ... } and indent selected text. That's even more awesome!
@gnysek That is pretty cool! It sounds like a handy shortcut for some situations.
 
S

Scoremonger

Guest
@Nocturne By the way, is there a way to see these bugs once they've been entered? I used the bug submission form at account dot yoyogames dot com slash report-bug (I haven't posted enough times to add a direct link, sorry), but this provides no fields for entering my user info. My fear is these sorts of requests go straight into the trash. ;)
 
Top