]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/treesit.el (treesit-simple-imenu): Restore the previous behavior.
authorJuri Linkov <juri@linkov.net>
Fri, 16 May 2025 16:03:41 +0000 (19:03 +0300)
committerEshel Yaron <me@eshelyaron.com>
Tue, 20 May 2025 20:52:03 +0000 (22:52 +0200)
Use 'treesit-parser-list' again to not depend on the cursor's position
(bug#78456).

(cherry picked from commit 7d7d821c495abcd740fd20f6a8df6da5bd920cd3)

lisp/treesit.el

index c2dc9ab460202fe05f78186c646a994514795bf4..dafbf6d14b2e208416ed4e5957b50000e0d61152 100644 (file)
@@ -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