]> git.eshelyaron.com Git - emacs.git/commitdiff
js-mode: Fix indent problem after a regexp
authorDmitry Gutov <dgutov@yandex.ru>
Wed, 16 Nov 2016 23:58:59 +0000 (01:58 +0200)
committerDmitry Gutov <dgutov@yandex.ru>
Wed, 16 Nov 2016 23:59:18 +0000 (01:59 +0200)
* lisp/progmodes/js.el (js--looking-at-operator-p): Check that the
slash is not ending a regexp (bug#24854).

lisp/progmodes/js.el

index f024d397ffb5790bfcdadd6fc13a9c3f2d513c51..6d995a095e6c908ff684fe80cef9e04902a0f6bd 100644 (file)
@@ -1756,6 +1756,10 @@ This performs fontification according to `js--class-styles'."
              (save-excursion
                (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).