Function: markdown-ts--list-item-region

markdown-ts--list-item-region is a byte-compiled function defined in markdown-ts-mode.el.gz.

Signature

(markdown-ts--list-item-region ITEM)

Documentation

Return the (BEG . END) region for ITEM, clamped to full lines.

BEG starts at the beginning of the line containing the item. END is clamped so it does not extend into the next line's indentation, which tree-sitter may include in the node.

Source Code

;; Defined in /usr/src/emacs/lisp/textmodes/markdown-ts-mode.el.gz
(defun markdown-ts--list-item-region (item)
  "Return the (BEG . END) region for ITEM, clamped to full lines.
BEG starts at the beginning of the line containing the item.
END is clamped so it does not extend into the next line's
indentation, which tree-sitter may include in the node."
  (let ((beg (save-excursion
               (goto-char (treesit-node-start item))
               (line-beginning-position)))
        (end (save-excursion
               (goto-char (treesit-node-end item))
               (if (bolp) (point) (line-beginning-position)))))
    (cons beg end)))