Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refined incremental selection #98

Open
glyh opened this issue Aug 5, 2021 · 1 comment
Open

Refined incremental selection #98

glyh opened this issue Aug 5, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@glyh
Copy link

glyh commented Aug 5, 2021

Although the original incremental selection is good, it can be improved. It goes from the very bottom to the top, which can be tedious sometimes. Leveraging text objects, we can ensure that what we select are always that text object we specified earlier.

Refined incremental selection work this way:
User type some command that specify a text object and enter visual mode.
When user increase or decrease the node in the syntax tree, he can only reach a new text object (or syntax structure) that can match the query.

I have some time and I'm happy to contribute this feature. XD

@glyh glyh added the enhancement New feature or request label Aug 5, 2021
@glyh
Copy link
Author

glyh commented Aug 5, 2021

For example, the following lua code:

function x()
  b = 2
  lambda = function()
    a = 1
  end
  c = 3
end

When user's cursor is in the function lambda, and run a command to select a text object that matches function.outer, he can only select the whole function, and when he increases, he will select function x, rather than the assignment for lambda.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant