4coder » Forums » indentation question anonymous functions
Peixoto
Pedro Peixoto
2 posts
#17133 indentation question anonymous functions
1 week, 4 days 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.
Delix
Ryan Fleury
142 posts / 1 project

Handmade Network lead and developer of The Melodist

#17139 indentation question anonymous functions
1 week, 3 days 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
rationalcoder
Blake Martin
11 posts
#17148 indentation question anonymous functions
1 week, 2 days 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.