paradigm / TextObjectify

TextObjectify is a Vim plugin which improves text-objects
100 stars 6 forks source link

Plugin deletes a "<" when using `cit` and tag is empty #3

Open nandryshak opened 11 years ago

nandryshak commented 11 years ago

Say I have an HTML tag like this:

<p></p>

Put the cursor anywhere on the tag and type cit (change inner tag). You get this:

<p>|/p>

where | is the cursor.

paradigm commented 11 years ago

That's definitely a bug. It seems TextObjectify isn't acting properly when there is nothing between the delimiters. I'll look into it.

nandryshak commented 11 years ago

Thanks. Also if there's a space (like this <p> </p>) and you do cit it deletes the whole tag. Two spaces works fine, as well as a new line. That is, cit on

<p>
</p>

works as expected.

paradigm commented 11 years ago

Fixed in dacfa7b6c6eef75397eb36e9a1d0c8e3f6f8de42

nandryshak commented 11 years ago

It seems as though the original issue is persistent (Plugin deletes a "<" when using cit and tag is empty). But this: (Also if there's a space (like this

) and you do cit it deletes the whole tag) looks fixed.

paradigm commented 11 years ago

Yeah, you're right. I'm not sure why I thought this was fixed. I appreciate you commenting again on it. I'm a bit swamped at the moment with other priorities, but I'll get back to this within the next month or so and be sure I fix it correctly this time.

ChanderG commented 5 years ago

I have a hack to work around this here. I can open a PR if there is any interest.