Function: neocaml--empty-line-offset

neocaml--empty-line-offset is a natively compiled function defined in neocaml.el.

Signature

(neocaml--empty-line-offset NODE PARENT BOL)

Documentation

Compute extra indentation offset for an empty line at BOL.

If the last token on the previous line expects a body (e.g., =,
->, then), return neocaml-indent-offset. Otherwise return 0,
which preserves the previous line's indentation level.

Source Code

;; Defined in /nix/store/ahssdx4rwzyxhyhavpn0bkznk13xrggi-emacs-packages-deps/share/emacs/site-lisp/elpa/neocaml-20260907.2015/neocaml.el
(defun neocaml--empty-line-offset (_node _parent bol)
  "Compute extra indentation offset for an empty line at BOL.
If the last token on the previous line expects a body (e.g., `=',
`->', `then'), return `neocaml-indent-offset'.  Otherwise return 0,
which preserves the previous line's indentation level."
  (save-excursion
    (goto-char bol)
    (if (and (zerop (forward-line -1))
             (progn
               (end-of-line)
               (skip-chars-backward " \t")
               (> (point) (line-beginning-position)))
             (let ((node (treesit-node-at (1- (point)))))
               (and node
                    (member (treesit-node-type node)
                            neocaml--indent-body-tokens))))
        neocaml-indent-offset
      0)))