Register
4coder»Forums»indentation question anonymous functions
Pedro Peixoto
2 posts
indentation question anonymous functions
1 year ago Edited by Pedro Peixoto on Jan. 5, 2019, 11:22 p.m.
Hi!,

Today i had to edit a bit of javascript and i decided to give 4coder a try, but there is a problem with anonymous functions and the way auto indentation works.

1
2
3
$(document).ready(function() {
                      console.log( "ready!" );
                      });


this happens, it's not that big of a deal since there are ways around it, you can just declare the function, I was just curious if someone already tried to solve this problem or tried to implement javascript in 4coder.
Ryan Fleury
177 posts / 1 project

Handmade Network lead and developer of The Melodist

indentation question anonymous functions
1 year ago
I believe Allen has said previously that 4coder doesn't work too well with brackets inside parentheses at the moment (I've had similar issues with some macros in C). At the end of the day, I bite the bullet and just let it be a little weird, or find some workaround (in your case, you'd just declare the function somewhere else). You can also turn off virtual whitespace and indent stuff manually, if you'd like (use alt+x and search for "virtual", which will give you the option to turn off the auto-indentation feature).

Handmade Network lead and developer of The Melodist
Blake Martin
31 posts
indentation question anonymous functions
1 year ago
That is, you _will_ be able to disable virtual whitespace in the future. Unfortunately, that day is not today, as disabling virtual whitespace crashes 4coder.