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

Support empty text objects #81

Open
alberto-lazari opened this issue Jul 17, 2023 · 0 comments
Open

Support empty text objects #81

alberto-lazari opened this issue Jul 17, 2023 · 0 comments

Comments

@alberto-lazari
Copy link

When defining text objects with regex it is not possible to match an empty inner object.

Example

I define a custom math text object for LaTeX $x$.
If I type ci$ I end having $$, so far so good, but if I want to get into the object, and type ci$ again I would expect nothing to change and the cursor to place into $$, just like it works for () [] {} and other native stuff.

This is probably a limitation of Vim's regexes. I think that you can define dedicated function for all the possible movements, but that would be a real hassle (like, define di$ to first check if it is empty, then do other stuff. Repeat for di$, yi$, vi$, etc...)

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

1 participant