Skip to content

[mini.ai] How to grab entire lines when using function text object #1488

Closed Answered by echasnovski
tonymajestro asked this question in Q&A
Discussion options

You must be logged in to vote

Let's first settle on the use case: do you mean by "entire function" the "entire function call" (like my_fun(1, 2)) or "entire function definition" (like function my_fun(a, b) ... end)? The first one is the one provided in 'mini.ai' by default, while the use case with new lines sounds like the second one.

The built-in function call is indeed a charwise textobject which means it won't include new lines (so as to have as narrow scope as possible).

The function definition textobject can (and should) be implemented with the help of tree-sitter and it will include only the region that is provided by the respective tree-sitter query.

Regardless of all of that, though, the previous workflow of "…

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@tonymajestro
Comment options

@echasnovski
Comment options

@tonymajestro
Comment options

@tonymajestro
Comment options

@echasnovski
Comment options

Answer selected by echasnovski
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested mini.ai
2 participants