From d78745581bdf7daf77602eb0bd06b6bdccc3c3c6 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 * lisp/treesit.el (treesit--explorer-tree-mode-map): Define it as a child of special-mode-map, adding multiple keys for button navigation. --- lisp/treesit.el | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lisp/treesit.el b/lisp/treesit.el index eb3e26fff7e..9925f8ee014 100644 --- a/lisp/treesit.el +++ b/lisp/treesit.el @@ -3907,6 +3907,17 @@ 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 + "f" #'forward-button + "b" #'backward-button + "TAB" #'forward-button + "" #'backward-button) + (defun treesit-explorer-switch-parser (parser) "Switch explorer to use PARSER." (interactive -- 2.47.0