From: Yuan Fu Date: Fri, 13 May 2022 23:34:26 +0000 (-0700) Subject: * lisp/treesit.el (treesit-node-at): Add check for nil node. X-Git-Tag: emacs-29.0.90~1925 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=750090fd076e6923c5cee6f67b170416d48694da;p=emacs.git * lisp/treesit.el (treesit-node-at): Add check for nil node. --- diff --git a/lisp/treesit.el b/lisp/treesit.el index 345aaf2e9b8..60f375e9d92 100644 --- a/lisp/treesit.el +++ b/lisp/treesit.el @@ -143,7 +143,7 @@ that language in the current buffer, and use that." (treesit-parser-root-node parser-or-lang) (treesit-buffer-root-node parser-or-lang)))) ;; TODO: We might want a `treesit-node-decendant-for-pos' in C. - (while (cond ((< (treesit-node-end node) point) + (while (cond ((and node (< (treesit-node-end node) point)) (setq node (treesit-node-next-sibling node)) t) ((treesit-node-child node 0 named)