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

Cursor position #17

Open
marcantonio opened this issue Oct 4, 2024 · 1 comment
Open

Cursor position #17

marcantonio opened this issue Oct 4, 2024 · 1 comment

Comments

@marcantonio
Copy link

Thanks for this package.

Is it possible to select the block based only on the line the cursor is on, vs now the cursor needs to be in the block. For example:

class foo {
 *  fn bar() {|
    }
}

Now it seems that to fold bar the cursor must be at |. Folding at * folds foo. I'd like to be able to fold bar from *.

Hopefully that makes sense!

If not available now, would you be interested in a PR?

@jcs090218
Copy link
Member

treesit-fold is designed to provide only the basic folding functionality. I recommend you wrap the folding logic yourself. 🤔

This is what I used, and it has similar functionality you have described:

https://github.com/emacs-vs/vs-edit-mode/blob/d800bd246107af657027b95e83229a74309d0a2c/vs-edit-mode.el#L401-L470

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

No branches or pull requests

2 participants