]> code.delx.au - gnu-emacs-elpa/commitdiff
Fix #247, indentation inside block comments
authorDmitry Gutov <dgutov@yandex.ru>
Tue, 21 Jul 2015 10:58:59 +0000 (13:58 +0300)
committerDmitry Gutov <dgutov@yandex.ru>
Tue, 21 Jul 2015 10:58:59 +0000 (13:58 +0300)
js2-old-indent.el

index 9b1c9296f0df31e09b05eed47ea2a24513f4cd69..efc9053a2e8118c6615f8640b5c6e8a409f086c8 100644 (file)
@@ -396,7 +396,7 @@ indentation is aligned to that column."
   (save-excursion
     (back-to-indentation)
     (when (nth 4 parse-status)
-      (cl-return (js2-lineup-comment parse-status)))
+      (cl-return-from js2-proper-indentation (js2--comment-indent parse-status)))
     (let* ((at-closing-bracket (looking-at "[]})]"))
            (same-indent-p (or at-closing-bracket
                               (looking-at "\\_<case\\_>[^:]")
@@ -458,17 +458,13 @@ indentation is aligned to that column."
 
        (t 0)))))
 
-(defun js2-lineup-comment (parse-status)
-  "Indent a multi-line block comment continuation line."
-  (let* ((beg (nth 8 parse-status))
-         (first-line (js2-same-line beg))
-         (offset (save-excursion
-                   (goto-char beg)
-                   (if (looking-at "/\\*")
-                       (+ 1 (current-column))
-                     0))))
-    (unless first-line
-      (indent-line-to offset))))
+(defun js2--comment-indent (parse-status)
+  "Indentation inside a multi-line block comment continuation line."
+  (save-excursion
+    (goto-char (nth 8 parse-status))
+    (if (looking-at "/\\*")
+        (+ 1 (current-column))
+      0)))
 
 (defun js2-indent-line (&optional bounce-backwards)
   "Indent the current line as JavaScript source text."