Function: sqlind-indent-comment-continuation

sqlind-indent-comment-continuation is a natively compiled function defined in sql-indent.el.

Signature

(sqlind-indent-comment-continuation SYNTAX BASE-INDENTATION)

Documentation

Return the indentation for a line inside a comment SYNTAX.

If the current line matches sqlind-comment-prefix or sqlind-comment-end, we indent to one plus the column of the comment start, which will make comments line up nicely, like this:

   /* Some comment line
    * another comment line
    */

When the current line does not match sqlind-comment-prefix, we indent it so it lines up with the text of the start of the comment, like this:

   /* Some comment line
      Some other comment line
    */

Source Code

;; Defined in /nix/store/jxjf2h9nnkdqnn1w1mr0ag8bqng2rlrs-emacs-packages-deps/share/emacs/site-lisp/elpa/sql-indent-1.7/sql-indent.el
(defun sqlind-indent-comment-continuation (syntax _base-indentation)
  "Return the indentation for a line inside a comment SYNTAX.
If the current line matches `sqlind-comment-prefix' or
`sqlind-comment-end', we indent to one plus the column of the
comment start, which will make comments line up nicely, like
this:

   /* Some comment line
    * another comment line
    */

When the current line does not match `sqlind-comment-prefix', we
indent it so it lines up with the text of the start of the
comment, like this:

   /* Some comment line
      Some other comment line
    */"
  (save-excursion
    (back-to-indentation)
    (if (or (looking-at sqlind-comment-prefix)
            (looking-at sqlind-comment-end))
        (progn
          (goto-char (sqlind-anchor-point syntax))
          (1+ (current-column)))
      ;; else
      (goto-char (sqlind-anchor-point syntax))
      (when (looking-at sqlind-comment-start-skip)
        (goto-char (match-end 0)))
      (current-column))))