projects
/
emacs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
497018d
)
Check the anchor along with the offset in treesit-indent-region
author
Daniel Martín
<mardani29@yahoo.es>
Sat, 25 Feb 2023 02:07:55 +0000
(
03:07
+0100)
committer
Yuan Fu
<casouri@gmail.com>
Sat, 25 Feb 2023 05:12:47 +0000
(21:12 -0800)
* lisp/treesit.el (treesit-indent-region): To compute a valid column,
having a non-nil offset is not enough, we need a non-nil anchor as
well.
lisp/treesit.el
patch
|
blob
|
history
diff --git
a/lisp/treesit.el
b/lisp/treesit.el
index 045fdf21cbaf388a7211949d2f33f62c208c2ea3..1decfc3d7cff9aec2c86cfe2229fb5cf8154c803 100644
(file)
--- a/
lisp/treesit.el
+++ b/
lisp/treesit.el
@@
-1533,7
+1533,7
@@
Similar to `treesit-indent', but indent a region instead."
(dotimes (jdx idx)
(let ((anchor (aref meta-vec (* jdx meta-len)))
(offset (aref meta-vec (+ 1 (* jdx meta-len)))))
- (when
offset
+ (when
(and anchor offset)
(let ((col (save-excursion
(goto-char anchor)
(+ offset (current-column)))))