Function: go-ts-mode--comment-on-previous-line-p

go-ts-mode--comment-on-previous-line-p is a byte-compiled function defined in go-ts-mode.el.gz.

Signature

(go-ts-mode--comment-on-previous-line-p)

Documentation

Return t if the previous line is a comment.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/go-ts-mode.el.gz
(defun go-ts-mode--comment-on-previous-line-p ()
  "Return t if the previous line is a comment."
  (when-let* ((point (- (pos-bol) 1))
              ((> point 0))
              (node (treesit-node-at point)))
    (and
     ;; check point is actually inside the found node
     ;; treesit-node-at can return nodes after point
     (<= (treesit-node-start node) point (treesit-node-end node))
     (string-equal "comment" (treesit-node-type node)))))