]> code.delx.au - gnu-emacs-elpa/commitdiff
Reapply the fix from 83ba85
authorDmitry Gutov <dgutov@yandex.ru>
Fri, 20 Apr 2012 01:54:44 +0000 (05:54 +0400)
committerDmitry Gutov <dgutov@yandex.ru>
Fri, 20 Apr 2012 01:54:44 +0000 (05:54 +0400)
js2-mode.el

index 8846332a6bedaee9aff30c7fede404c68dbb3b5b..2f30283610b2beb5c80a49c448b66c3f107e2c07 100644 (file)
@@ -9610,12 +9610,13 @@ and comments have been removed."
   (save-excursion
     (back-to-indentation)
     (or (js2-looking-at-operator-p)
-        (when (js2-re-search-backward "\n" nil t)  ;; comment
+        (when (js2-re-search-backward "\n" nil t)  ;; skip comments
           (skip-chars-backward " \t")
-          (backward-char)
-          (when (js2-looking-at-operator-p)
+          (unless (bolp) ;; previous line is empty
             (backward-char)
-            (not (looking-at "\\*\\|++\\|--\\|/[/*]")))))))
+            (when (js2-looking-at-operator-p)
+              (backward-char)
+              (not (looking-at "\\*\\|++\\|--\\|/[/*]"))))))))
 
 (defun js2-end-of-do-while-loop-p ()
   "Return non-nil if word after point is `while' of a do-while