Closed ebrannin-bw closed 1 year ago
I think I agree. However, surround.vim is merely delegating to Vim's built-in at
operator. You can see the same behavior if you do dat
or gUat
.
And I don't plan on breaking with Vim here. You could try floating your proposal to Vim itself, but I doubt it would be considered due to backwards compatibility concerns.
Makes sense, thanks!
Looks like vim has already documented this:
"<aaa/>"
items are skipped. Case is ignored, also for XML where case does matter.
Sounds like what I really want is a custom text-object plugin to declare something like aT
and iT
(or whatever, but it seems like those aren't built-in) -- I'll update here if I find one already exists or (very eventually) figure out how to write one.
Sounds like what I really want is a custom text-object plugin
Yes, but see #355.
Oops, I meant to link to https://github.com/tpope/vim-surround/issues/329#issuecomment-922978875.
Steps to reproduce
<inner />
:/inn
ysat<middle>
(not shown below) or`ysat<C-T>middle>
(shown)Expected result:
Observed result
Workaround
ysa<<middle>
orysa<<C-T>middle>
Background
Self-closing tags come up in HTML5, XML, React, etc.
I was just turning a React component from a flex-row into a table, and as I wrapped each element with
<td>
I had to switch betweenysat
andysa<
depending on if it was self-closing or not.