tamzinblake / js3-mode

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

Incorrect brace-skipping behavior #30

Closed tamzinblake closed 12 years ago

tamzinblake commented 13 years ago

Not sure what is causing this example.

example:

  var boolReg = '^(' + boolFields.join('|') + ')$'
                                      , ignoreReg = '^(' + ignoreFields.join('|') + ')$'

should be:

  var boolReg = '^(' + boolFields.join('|') + ')$'
    , ignoreReg = '^(' + ignoreFields.join('|') + ')$'
tamzinblake commented 12 years ago

Probably happening because paren groups are not skipped recursively while searching backwards. It will skip over the set of quotes and stop skipping backwards when hitting a plus. js3-re-search-backwards can probably be made smarter to fix this and other issues.