Add button navigation to treesit-explorer (bug#75141)

* lisp/treesit.el (treesit--explorer-tree-mode-map): Define it
as a child of special-mode-map, adding keys for button
navigation.
This commit is contained in:
Gabriel Santos 2024-12-27 10:43:20 -03:00 committed by Yuan Fu
parent 40fbed939a
commit 493bb2eaf1
No known key found for this signature in database
GPG key ID: 56E19BC57664A442

View file

@ -4047,6 +4047,16 @@ covers point. PARSER-NAME are unique."
"Mode for displaying syntax trees for `treesit-explore-mode'."
nil)
(defvar-keymap treesit--explorer-tree-mode-map
:doc "Keymap for the treesit tree explorer.
Navigates from button to button."
:parent special-mode-map
"n" #'forward-button
"p" #'backward-button
"TAB" #'forward-button
"<backtab>" #'backward-button)
(defun treesit-explorer-switch-parser (parser)
"Switch explorer to use PARSER."
(interactive