From 750090fd076e6923c5cee6f67b170416d48694da Mon Sep 17 00:00:00 2001 From: Yuan Fu Date: Fri, 13 May 2022 16:34:26 -0700 Subject: [PATCH] * lisp/treesit.el (treesit-node-at): Add check for nil node. --- lisp/treesit.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -- 2.39.5