TextObjectify icon indicating copy to clipboard operation
TextObjectify copied to clipboard

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

Open nandryshak opened this issue 12 years ago • 6 comments

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.

nandryshak avatar Apr 08 '13 16:04 nandryshak

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

paradigm avatar Apr 08 '13 18:04 paradigm

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.

nandryshak avatar Apr 08 '13 18:04 nandryshak

Fixed in dacfa7b6c6eef75397eb36e9a1d0c8e3f6f8de42

paradigm avatar Apr 09 '13 13:04 paradigm

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.

nandryshak avatar Apr 15 '13 15:04 nandryshak

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.

paradigm avatar Apr 16 '13 02:04 paradigm

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

ChanderG avatar Sep 30 '18 14:09 ChanderG