about summary refs log tree commit diff
diff options
context:
space:
mode:
authorProfpatsch <mail@profpatsch.de>2020-12-19T19·25+0100
committerProfpatsch <mail@profpatsch.de>2021-01-01T22·40+0000
commit3279786cd221eafc876ca1987c04efe108ed0660 (patch)
treedbd5aa7307aa0de31a638dd497b8616c2900f601
parente07e88d81d3a33365575f8d0b464b5ce21a0fc8e (diff)
feat(emacs-tree-sitter-move): add a simple down movement as well r/2045
Always goes to the first child for now.

Change-Id: I1d00b2f2013ba7e5f88622d1de3c99500e5f1a7a
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2261
Reviewed-by: Profpatsch <mail@profpatsch.de>
Tested-by: BuildkiteCI
-rw-r--r--users/Profpatsch/emacs-tree-sitter-move/tree-sitter-move.el8
1 files changed, 4 insertions, 4 deletions
diff --git a/users/Profpatsch/emacs-tree-sitter-move/tree-sitter-move.el b/users/Profpatsch/emacs-tree-sitter-move/tree-sitter-move.el
index 0fd16e675211..c23e401f0a23 100644
--- a/users/Profpatsch/emacs-tree-sitter-move/tree-sitter-move.el
+++ b/users/Profpatsch/emacs-tree-sitter-move/tree-sitter-move.el
@@ -94,10 +94,10 @@
   (interactive)
   (tree-sitter-move--move-skip-non-sibling-nodes 'tsc-get-parent))
 
-;; TODO doesn’t work yet because sibling nodes are only skipped upwards
-;; (defun tree-sitter-move-down ()
-;;   (interactive)
-;;   (tree-sitter-move--move-skip-non-sibling-nodes (lambda (n) (tsc-get-nth-named-child n 0))))
+;; TODO: does not skip siblings yet, because the skip function only goes up (not down)
+(defun tree-sitter-move-down ()
+  (interactive)
+  (tree-sitter-move--move-if-possible (lambda (n) (tsc-get-nth-named-child n 0))))
 
 (defun tree-sitter-move--move-skip-non-sibling-nodes (move-fn)
   "Moves to the sidewards next sibling. If the current node does not have siblings, go