tamzinblake / js3-mode

A chimeric fork of js2-mode and js-mode
GNU General Public License v3.0
181 stars 13 forks source link

broken indentation regarding regex literals #40

Closed tamzinblake closed 12 years ago

tamzinblake commented 12 years ago

Example:

    // ** GFM **  Auto-link URLs and emails
    text = text.replace( /https?\:\/\/[^"\s\<\>]*[^.,;'">\:\s\<\>\)\]\!]/g
                       , function (wholeMatch,matchIndex) {
                                                       var left = text.slice(0, matchIndex), right = text.slice(matchIndex)

should be:

    // ** GFM **  Auto-link URLs and emails
    text = text.replace( /https?\:\/\/[^"\s\<\>]*[^.,;'">\:\s\<\>\)\]\!]/g
                       , function (wholeMatch,matchIndex) {
                           var left = text.slice(0, matchIndex), right = text.slice(matchIndex)

(assuming the current implementation of function indentation is correct)

tamzinblake commented 12 years ago

Probably because some parts of the indentation still rely on the c-engine rather than AST for indentation.

tamzinblake commented 12 years ago

In fact, I think this issue had little to nothing to do with regexes. Still, fixed.