|
From: | Dmitry Gutov |
Subject: | bug#60894: 30.0.50; [PATCH] Add treesit-forward-sexp |
Date: | Tue, 17 Jan 2023 22:53:09 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 |
1. What should a sexp be? Is it basically "everything", or is there a distincition between "word", "sexp" and "sentence"? For lisp forward-sexp looks like a "jump over words, or a balanced pair of parens". In other languages that can look a little weird - consider: ``` foo().|bar().baz(); -> foo().bar|().baz(); -> foo().bar()|.baz(); ```In a sense it could be considered "better", or at least distinct fromforward-word to: ``` foo().|bar().baz(); -> foo().bar()|.baz(); -> foo().bar().baz()|;
One of the key things for Ruby, I think, is to jump over expressions. E.g. when the point is before 'def' in def foo ... end forward-sexp jumps to after 'end'. And backward-sexp jumps back. Same for if 2 == 3 ... end, parenthesized expressions and (less important) method calls and statements as well.
[Prev in Thread] | Current Thread | [Next in Thread] |