Function: zig-ts--fill-paragraph

zig-ts--fill-paragraph is a natively compiled function defined in zig-ts-mode.el.

Signature

(zig-ts--fill-paragraph &optional JUSTIFY)

Documentation

Fill the Zig paragraph at point.

Use tree-sitter to detect multiline-string and doc-comment. Return t if point is in a multiline_string block or doc comment block, otherwise let the default handler run.

Source Code

;; Defined in /nix/store/jxyx97fhclw4jb395hn97pz60n2rh0hs-emacs-packages-deps/share/emacs/site-lisp/elpa/zig-ts-mode-20260921.1554/zig-ts-mode.el
(defun zig-ts--fill-paragraph (&optional _justify)
  "Fill the Zig paragraph at point.
Use tree-sitter to detect multiline-string and doc-comment.  Return t if
point is in a multiline_string block or doc comment block, otherwise let
the default handler run."
  (let* ((node (treesit-node-at (point)))
         (type (treesit-node-type node))
         (doc-comment-p (and (string= type "comment")
                             (save-excursion
                               (goto-char (treesit-node-start node))
                               (looking-at "//\\(?:!\\|/\\(?:[^/]\\|$\\)\\)"))))
         (multiline-string-p (string= type "multiline_string")))
    (when (or doc-comment-p multiline-string-p)
      ;; Return t so `fill-paragraph' doesn't attempt to fill by itself
      t)))