Check the anchor along with the offset in treesit-indent-region
* 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.
This commit is contained in:
parent
497018dd5c
commit
5cf50d6004
1 changed files with 1 additions and 1 deletions
|
@ -1533,7 +1533,7 @@ Similar to `treesit-indent', but indent a region instead."
|
||||||
(dotimes (jdx idx)
|
(dotimes (jdx idx)
|
||||||
(let ((anchor (aref meta-vec (* jdx meta-len)))
|
(let ((anchor (aref meta-vec (* jdx meta-len)))
|
||||||
(offset (aref meta-vec (+ 1 (* jdx meta-len)))))
|
(offset (aref meta-vec (+ 1 (* jdx meta-len)))))
|
||||||
(when offset
|
(when (and anchor offset)
|
||||||
(let ((col (save-excursion
|
(let ((col (save-excursion
|
||||||
(goto-char anchor)
|
(goto-char anchor)
|
||||||
(+ offset (current-column)))))
|
(+ offset (current-column)))))
|
||||||
|
|
Loading…
Add table
Reference in a new issue