Hacker News new | ask | show | jobs
by rodly 5086 days ago
I recall using jsbin a month or so ago and had it fail on some basic JS I had inputted to test it out. Anecdotal and without proof but that is what made me decide on using jsfiddle. Going to give jsbin another try with this new version.

*edit:

This frustrates me so much on jsfiddle and I'm guessing it's a default browser formatting thing but why don't you guys make the curly braces NOT leap forward from where my cursor is?

Example : http://i.imgur.com/mZXTO.png

2 comments

WRT formatting, a lot of JS coders think you should always begin your curly braces on the same line as the statement, not on the next, or you risk the wrath of automatic semicolon insertion. The formatter seems fine if you do it this way, and it's also a generally good idea to avoid bizarre, hard to track down bugs.

But I'd understand if that's not an acceptable answer for you.

> not on the next, or you risk the wrath of automatic semicolon insertion.

That's to e.g. return an object though.

On the other hand, allman with anonymous functions? That's completely bonkers-looking.

It's a setting in CodeMirror which jsbin and jsfiddle both make use of.

However, if you open the devtools console in your browser, and run: `jsbin.settings.editor.smartIndent = false` it'll disable the indenting. The setting is sticky, so you it should remain whilst the data is stored against the browser.

To that note, is there a page listing out all of these settings overrides? I'm thinking we could each have our own versions of .vimrc for JSBIN :-P
Not yet, but there will be. For the moment, anything you can set in CodeMirror's config ( http://codemirror.net/doc/manual.html#config ) you can set via `jsbin.settings.editor.[key] = [value]` and it'll apply it to the JS Bin editors.

There's a couple of others, and docs will be coming soon. In addition, there's an exposed API that allows you to point JS Bin to a JSON file and it'll load in and save those settings - which is useful for starting a class for teaching where you want the editor in the same mode across all the students.