Skip to content

Support empty text objects #81

@alberto-lazari

Description

@alberto-lazari

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...)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions