From: Juri Linkov Date: Fri, 16 May 2025 16:03:41 +0000 (+0300) Subject: * lisp/treesit.el (treesit-simple-imenu): Restore the previous behavior. X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=e8531b2f576403cb45be31af14751296119aa07c;p=emacs.git * lisp/treesit.el (treesit-simple-imenu): Restore the previous behavior. Use 'treesit-parser-list' again to not depend on the cursor's position (bug#78456). (cherry picked from commit 7d7d821c495abcd740fd20f6a8df6da5bd920cd3) --- diff --git a/lisp/treesit.el b/lisp/treesit.el index c2dc9ab4602..dafbf6d14b2 100644 --- a/lisp/treesit.el +++ b/lisp/treesit.el @@ -3971,8 +3971,9 @@ by `treesit-simple-imenu-settings'." (lambda (entry) (let* ((lang (car entry)) (settings (cdr entry)) - (global-parser (car (treesit-parsers-at nil lang nil '(primary global)))) - (local-parsers (treesit-local-parsers-at nil lang))) + (global-parser (car (treesit-parser-list nil lang))) + (local-parsers + (treesit-parser-list nil lang 'embedded))) (cons (treesit-language-display-name lang) ;; No one says you can't have both global and local ;; parsers for the same language. E.g., Rust uses