GNU bug report logs -
#68993
treesitter support for forward-sexp-default-function
Previous Next
Reported by: Juri Linkov <juri <at> linkov.net>
Date: Thu, 8 Feb 2024 17:42:01 UTC
Severity: normal
Fixed in version 30.0.50
Done: Juri Linkov <juri <at> linkov.net>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Hi Yuan,
Do you think 'comment' is a suitable name for 'treesit-forward-sexp'?
I'm unsure even if 'text' is a good name for 'treesit-forward-sentence'.
But at least these two should be consistent with each another.
Maybe better to add the prefix 'default-' to both?
This will hint that the default function is used.
Then 'treesit-forward-sentence' will support types
'sentence' and 'default-sentence'.
And 'treesit-forward-sexp' will support types
'sexp' and 'default-sexp'.
> @@ -2137,7 +2137,10 @@ treesit-forward-sexp
> (interactive "^p")
> (let ((arg (or arg 1))
> (pred (or treesit-sexp-type-regexp 'sexp)))
> - (or (if (> arg 0)
> + (or (when (treesit-node-match-p (treesit-node-at (point)) 'comment t)
> + (funcall #'forward-sexp-default-function arg)
> + t)
> + (if (> arg 0)
> (treesit-end-of-thing pred (abs arg) 'restricted)
> (treesit-beginning-of-thing pred (abs arg) 'restricted))
> ;; If we couldn't move, we should signal an error and report
This bug report was last modified 1 year and 92 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.