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:
@@ -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)))))
|
||||
|
||||
Reference in New Issue
Block a user