* lisp/progmodes/ruby-ts-mode.el (ruby-ts-mode): Add 'text' (bug#67036).
Add 'text' lambda to 'treesit-thing-settings' that should fall back to the default functions for sentence/sexp navigation.
This commit is contained in:
parent
bf026b8e55
commit
a1613505e2
1 changed files with 16 additions and 1 deletions
|
|
@ -1171,7 +1171,22 @@ leading double colon is not added."
|
|||
"global_variable"
|
||||
)
|
||||
eol)
|
||||
#'ruby-ts--sexp-p)))))
|
||||
#'ruby-ts--sexp-p))
|
||||
(text ,(lambda (node)
|
||||
(or (member (treesit-node-type node)
|
||||
'("comment" "string_content" "heredoc_content"))
|
||||
;; for C-M-f in hash[:key] and hash['key']
|
||||
(and (member (treesit-node-text node)
|
||||
'("[" "]"))
|
||||
(equal (treesit-node-type
|
||||
(treesit-node-parent node))
|
||||
"element_reference"))
|
||||
;; for C-M-f in "abc #{ghi} def"
|
||||
(and (member (treesit-node-text node)
|
||||
'("#{" "}"))
|
||||
(equal (treesit-node-type
|
||||
(treesit-node-parent node))
|
||||
"interpolation"))))))))
|
||||
|
||||
;; AFAIK, Ruby can not nest methods
|
||||
(setq-local treesit-defun-prefer-top-level nil)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue