emacs-evil / evil-surround

you will be surrounded (surround.vim for evil, the extensible vi layer)

Repository from Github https://github.comemacs-evil/evil-surroundRepository from Github https://github.comemacs-evil/evil-surround

Deleting surrounding tags leaves a blank line

angrybacon opened this issue · comments

Deleting surrounding pair with dst from

<Parent><Something />
</Parent>

To

  
 <Something />
  

(█ is the point)

Leaves blank lines around the children. Is that by design or customizable?

@angrybacon this is by design. It works the same in https://github.com/tpope/vim-surround. It's not customizable, and I think making it customizable would be non-trivial. Would your preferred logic be to delete the entire line if a deleted tag is the only thing on the line?

Thanks for confirming. I now see how that could be problematic but with automatically prettified code, I never have things like:

<Parent><Something><Something />
</Something></Parent>

Would your preferred logic be to delete the entire line if a deleted tag is the only thing on the line?

Yep

OK, makes sense. I'd welcome a well-considered PR to add this as an (off-by-default) option, if it doesn't make the code around deletion too complicated.