]> code.delx.au - gnu-emacs-elpa/commitdiff
fixed ugly indentation with multiple variable declaration. closes #1.
authormooz <stillpedant@gmail.com>
Tue, 28 Dec 2010 14:25:02 +0000 (23:25 +0900)
committermooz <stillpedant@gmail.com>
Tue, 28 Dec 2010 14:25:02 +0000 (23:25 +0900)
js2-mode.el

index 6b0bcab9b2d36fcbb9af1eee7c296cafb40c6014..142b91df8fe07e9fcc4639697b55d9ef465e73d9 100644 (file)
@@ -450,7 +450,7 @@ which doesn't seem particularly useful, but Rhino permits it."
   :type 'boolean
   :group 'js2-mode)
 
-(defvar js2-mode-version 20100402
+(defvar js2-mode-version 20101228
   "Release number for `js2-mode'.")
 
 ;; scanner variables
@@ -9767,6 +9767,16 @@ a comma)."
   (save-excursion
     (back-to-indentation)
     (or (js-looking-at-operator-p)
+        ;; var a = 10,
+        ;;     b = 20; <- this
+        (let* ((node (js2-node-at-point))
+               (pnode (js2-node-parent node)))
+          (and node
+               (= js2-NAME (js2-node-type node))
+               (or
+                (= js2-VAR (js2-node-type pnode))
+                (= js2-LET (js2-node-type pnode)))))
+        ;; comment
         (and (js-re-search-backward "\n" nil t)
             (progn
               (skip-chars-backward " \t")