emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master c69858b3f0: ; * lisp/treesit.el (treesit-ready-p): Guard against


From: Yuan Fu
Subject: master c69858b3f0: ; * lisp/treesit.el (treesit-ready-p): Guard against empty buffers.
Date: Tue, 22 Nov 2022 20:32:52 -0500 (EST)

branch: master
commit c69858b3f0ab32ed9287043c120949ec47dc54d4
Author: Yuan Fu <casouri@gmail.com>
Commit: Yuan Fu <casouri@gmail.com>

    ; * lisp/treesit.el (treesit-ready-p): Guard against empty buffers.
---
 lisp/treesit.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/treesit.el b/lisp/treesit.el
index 6042b7e6c9..3ea6fae4df 100644
--- a/lisp/treesit.el
+++ b/lisp/treesit.el
@@ -1602,7 +1602,8 @@ instead of emitting a warning."
       (when (not (treesit-available-p))
         (setq msg "tree-sitter library is not compiled with Emacs")
         (throw 'term nil))
-      (when (> (position-bytes (1- (point-max))) treesit-max-buffer-size)
+      (when (> (position-bytes (max (point-min) (1- (point-max))))
+               treesit-max-buffer-size)
         (setq msg "buffer larger than `treesit-max-buffer-size'")
         (throw 'term nil))
       (dolist (lang language-list)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]