mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-16 09:14:18 +00:00
* lisp/treesit.el: Small fixes in navigation functions.
(treesit-up-list): Better handle multi-language buffers. (treesit-hs-find-next-block): Fix off-by-one error.
This commit is contained in:
parent
208241aa83
commit
bbbad93498
1 changed files with 5 additions and 1 deletions
|
|
@ -3209,6 +3209,10 @@ ARG is described in the docstring of `up-list'."
|
|||
(or (when (and (null (or treesit-sexp-thing-up-list
|
||||
treesit-sexp-thing))
|
||||
default-pos
|
||||
;; The default function returns wrong results
|
||||
;; when crossing multi-language boundaries:
|
||||
(eq (treesit-language-at default-pos)
|
||||
(treesit-language-at (point)))
|
||||
(or (null parent)
|
||||
(if (> arg 0)
|
||||
(<= default-pos (treesit-node-end parent))
|
||||
|
|
@ -4207,7 +4211,7 @@ For BOUND, MOVE, BACKWARD, LOOKING-AT, see the descriptions in
|
|||
(comment-p (and comment-thing (eq beg (treesit-node-start comment-thing))))
|
||||
(thing (if comment-p comment-thing list-thing))
|
||||
(end (if thing (min (1+ (treesit-node-start thing)) (point-max)))))
|
||||
(when (and end (< end maxp))
|
||||
(when (and end (<= end maxp))
|
||||
(goto-char end)
|
||||
(set-match-data
|
||||
(if (and comments comment-p)
|
||||
|
|
|
|||
Loading…
Reference in a new issue