-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Description
it doesn't behave properly:
-
vim --nopluginfor instance -
:setf html -
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.