projects
/
emacs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
057901f
)
; * lisp/treesit.el (treesit-ready-p): Guard against empty buffers.
author
Yuan Fu
<casouri@gmail.com>
Wed, 23 Nov 2022 01:29:26 +0000
(17:29 -0800)
committer
Yuan Fu
<casouri@gmail.com>
Wed, 23 Nov 2022 01:29:26 +0000
(17:29 -0800)
lisp/treesit.el
patch
|
blob
|
history
diff --git
a/lisp/treesit.el
b/lisp/treesit.el
index 6042b7e6c96648b9675274d7a4150eea793b826f..3ea6fae4dfc228ed89a02aa2d606329f2f0ac21d 100644
(file)
--- 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)