Function: treesit--pre-redisplay

treesit--pre-redisplay is a byte-compiled function defined in treesit.el.gz.

Signature

(treesit--pre-redisplay &rest _)

Documentation

Force a reparse on the primary parser and mark regions to be fontified.

The actual work is carried out by treesit--font-lock-mark-ranges-to-fontify, which see.

Source Code

;; Defined in /usr/src/emacs/lisp/treesit.el.gz
(defun treesit--pre-redisplay (&rest _)
  "Force a reparse on the primary parser and mark regions to be fontified.

The actual work is carried out by
`treesit--font-lock-mark-ranges-to-fontify', which see."
  (unless (eq treesit--pre-redisplay-tick (buffer-chars-modified-tick))
    (when treesit-primary-parser
      ;; Force a reparse on the primary parser, if everything is setup
      ;; correctly, the parser should call
      ;; `treesit--font-lock-mark-ranges-to-fontify' (which should be a
      ;; notifier function of the primary parser).
      (treesit-parser-root-node treesit-primary-parser))

    (setq treesit--pre-redisplay-tick (buffer-chars-modified-tick))))