fix(tree-sitter): add derived-mode parents to ts-modes

ts-modes do this already in 30/31+ (`derived-mode-add-parents` was added
in 30), but is still needed for 29.x users and any ts-modes that haven't
adapted (many of them).

Fix: doomemacs/community#29
This commit is contained in:
Henrik Lissner
2025-09-07 10:21:10 -04:00
parent 8f55404781
commit 1adec8b10c
3 changed files with 17 additions and 9 deletions

View File

@@ -132,7 +132,8 @@ information.")
(let ((pred (car rule))
(plist (cdr rule)))
(and (or (and (symbolp pred)
(eq major-mode pred))
(or (eq major-mode pred)
(memq pred (get major-mode 'derived-mode-extra-parents))))
(and (stringp pred)
(stringp buffer-file-name)
(string-match-p pred buffer-file-name)))