Function: web-mode-comment-indent-new-line

web-mode-comment-indent-new-line is an interactive and natively compiled function defined in web-mode.el.

Signature

(web-mode-comment-indent-new-line &optional SOFT)

Key Bindings

This command is not in any keymaps.

Source Code

;; Defined in /nix/store/2qgnz1rp30nzfz6w0apx4kdm14if1bbs-emacs-packages-deps/share/emacs/site-lisp/elpa/web-mode-20260831.219/web-mode.el
(defun web-mode-comment-indent-new-line (&optional _soft)
  (interactive)
  (let (ctx)
    (setq ctx (web-mode-comment-context))
    (cond
      ((null ctx)
       (newline 1))
      (t
       (newline 1)
       (indent-line-to (plist-get ctx :col))
       (let ((prefix (plist-get ctx :prefix)))
         (insert
          (concat prefix
                  ;; Check if the comment ends with a space, and if not, insert one.
                  (if
                   (string-equal (substring prefix -1 (length prefix)) " ")
                   ""
                   " ")))))
      ) ;cond
    ))