Function: sqlind-indent-comment-start

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

Signature

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

Documentation

Return the indentation for a comment start SYNTAX.

If we start a line comment (--) and the previous line also has a line comment, we line up the two comments. Otherwise we indent in the previous context (cdr SYNTAX) starting at BASE-INDENTATION.

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-start (syntax base-indentation)
  "Return the indentation for a comment start SYNTAX.
If we start a line comment (--) and the previous line also has a
line comment, we line up the two comments.  Otherwise we indent
in the previous context (cdr SYNTAX) starting at
BASE-INDENTATION."
  (save-excursion
    (back-to-indentation)
    (if (and (looking-at "\\s *--")
	     (progn
	       (forward-line -1)
	       (re-search-forward "--" (line-end-position) t)))
	(progn
	  (goto-char (match-beginning 0))
	  (current-column))
      (sqlind-calculate-indentation
       (sqlind-outer-context syntax) base-indentation))))