From 68aa0e8b5d721bcd901ec723545108e104741662 Mon Sep 17 00:00:00 2001 From: Gabriel Santos Date: Fri, 27 Dec 2024 10:43:20 -0300 Subject: [PATCH] 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. (cherry picked from commit 493bb2eaf1610ec950e4a2f7229d6e1f939064b9) --- lisp/treesit.el | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lisp/treesit.el b/lisp/treesit.el index 49ccc53aa62..888efeea239 100644 --- a/lisp/treesit.el +++ b/lisp/treesit.el @@ -4040,6 +4040,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 + "" #'backward-button) + (defun treesit-explorer-switch-parser (parser) "Switch explorer to use PARSER." (interactive -- 2.39.5