Don't add the primary parser or the first of treesit-parser-list
when non-nil 'with-host' is provided since there is no host
for the primary parser (bug#76788).
(cherry picked from commit
2808bef2522481b3b3e6a7f2739ae8dbd02c13f5)
(and (memq 'global only)
(not (overlay-get ov 'treesit-parser-local-p))))))
(push (if with-host (cons parser host-parser) parser) res)))
- (when (and treesit-primary-parser (or (null only) (memq 'primary only)))
- (push treesit-primary-parser res))
- (unless res
- (push (car (treesit-parser-list)) res))
+ (when (and (not with-host) (or (null only) (memq 'primary only)))
+ (push (or treesit-primary-parser
+ (car (treesit-parser-list)))
+ res))
(seq-sort-by (lambda (p)
(treesit-parser-embed-level
(or (car-safe p) p)))