Search code examples
aptanacode-formattingaptana3

Aptana 3 - JavaScript formatter


The Aptana JS formatter handles this fine:

Manage.init = function() {
  --code here--
}

but it formats this:

$('#tab1').click(function() {
    $('li.voting.active').length === 0 ? Manage.loadTab(1) : Manage.loadVotingTab(1);
});

into:

$('#tab1').click(function() {$('li.voting.active').length === 0 ? Manage.loadTab(1) : Manage.loadVotingTab(1);
});

(the formatting not only removes the line break after the opening brace (shown here), but it also adds one line break added above and two below the block (not shown here)).

I can't find any formatter settings that change this. The correct behavior here would be to leave the code as it is. Any suggestions?


Solution

  • Yep. It's a bug, and I just opened an issue on the Appcelerator BTS at http://jira.appcelerator.org/browse/APSTUD-4064

    Add yourself as a 'watcher' to be notified when it's done.

    Thanks!