Function: treesit-forward-sentence

treesit-forward-sentence is a byte-compiled function defined in treesit.el.gz.

Signature

(treesit-forward-sentence &optional ARG)

Documentation

Tree-sitter forward-sentence-function implementation.

ARG is the same as in forward-sentence.

If point is inside a text environment, go forward a prose sentence using forward-sentence-default-function. If point is inside code, go forward a source code sentence.

What constitutes as text and source code sentence is determined by text and sentence in treesit-thing-settings.

View in manual

Probably introduced at or before Emacs version 30.1.

Source Code

;; Defined in /usr/src/emacs/lisp/treesit.el.gz
(defun treesit-forward-sentence (&optional arg)
  "Tree-sitter `forward-sentence-function' implementation.

ARG is the same as in `forward-sentence'.

If point is inside a text environment, go forward a prose
sentence using `forward-sentence-default-function'.  If point is
inside code, go forward a source code sentence.

What constitutes as text and source code sentence is determined
by `text' and `sentence' in `treesit-thing-settings'."
  (if (treesit-node-match-p (treesit-node-at (point)) 'text t)
      (funcall #'forward-sentence-default-function arg)
    (funcall
     (if (> arg 0) #'treesit-end-of-thing #'treesit-beginning-of-thing)
     'sentence (abs arg))))