diff options
author | Dmitry Gutov <dgutov@yandex.ru> | 2016-11-17 01:58:59 +0200 |
---|---|---|
committer | Dmitry Gutov <dgutov@yandex.ru> | 2016-11-17 01:59:18 +0200 |
commit | 4887e7c6cbe022bd54ec42f3bdceae8fa434a0cd (patch) | |
tree | 8c12dc883b8a5dcc338fb099bfb43eeb8f728ad3 | |
parent | e992ac0a639d01df8f04c18061b0d73f792ff2c2 (diff) | |
download | emacs-4887e7c6cbe022bd54ec42f3bdceae8fa434a0cd.tar.gz |
js-mode: Fix indent problem after a regexp
* lisp/progmodes/js.el (js--looking-at-operator-p): Check that the
slash is not ending a regexp (bug#24854).
-rw-r--r-- | lisp/progmodes/js.el | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el index f024d397ffb..6d995a095e6 100644 --- a/lisp/progmodes/js.el +++ b/lisp/progmodes/js.el @@ -1757,6 +1757,10 @@ This performs fontification according to `js--class-styles'." (and (js--re-search-backward "[?:{]\\|\\_<case\\_>" nil t) (eq (char-after) ??)))) (not (and + (eq (char-after) ?/) + (save-excursion + (eq (nth 3 (syntax-ppss)) ?/)))) + (not (and (eq (char-after) ?*) ;; Generator method (possibly using computed property). (looking-at (concat "\\* *\\(?:\\[\\|" js--name-re " *(\\)")) |