Skip to content

"inner tag" pending operator broken #3332

@dylnmc

Description

@dylnmc

it doesn't behave properly:

  1. vim --noplugin for instance

  2. :setf html

  3. i<div></div> esc

Now, if you do _cit it will appropriately place the cursor inside of the tag, as it should.

However, if you do 0f<cit then it will effectively do cat (change around tag), as it deletes the entire tag. The problem is that if the cursor is position on the start of the closing tag, and the tag is emtpy, then cit will not work properly, but instead it deletes the entire tag not just the inner tag.

I have also noticed some bugs when the tag is empty for tpope's vim-surround and also with (presumably) the default xmap (whatever it is ... vit).

For example (with vim-surround), if you use the above example (<div></div>) and do:

csttimg

(that's cst for change surrounding tag then another t for tag again--we're trying to change the divs to imgs--and finally img for the ... well, "img"--the tag we're changing it to) ... this does not work when the tag is empty, but it works when there is at least one character inside the tag.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions