+2

Reindent lines bug in Javascript

Petter Wichman 6 years ago 0

1. "Indentation:Reindent lines" does get confused by lines with faulty indentation...
In the example below i have "Tab size set to 4" and "Indent using spaces set"

2. Another bug in the "Indentation:Reindent lines" function: it gets confused by comments.

// Before 

namespace('lala', function() {

    initialize: function() {

      _debug("lala1"); // only indented by two spaces!

        _debug("lala2");

  }

});


// After "Indentation:Reindent lines"

namespace('lala', function() {

    initialize: function() {

      _debug("lala1"); <-- still only two spaces

      _debug("lala2");

  }

});


// Expected but not actual

namespace('lala', function() {

    initialize: function() {

        _debug("lala1"); // only indented by two spaces!

        _debug("lala2");

    }

});