Deleting nested tags in html #1606
-
Contributing guidelines
Module(s)mini.surround QuestionCurrently if i try to delete a surrounding using <div>
<div>
<p>Hello world</p>
</div>
</div>In this it would only delete the second <div>
<p>Another hello world</p>
<div>
<p>Hello world</p>
</div>
</div>This will now properly delete the Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
|
Sorry, this is a bit confusing:
This indicates that the problem is with 'mini.ai'...
... but the chosen "Module" and this question indicate that the issue is with 'mini.surround'. I suspect the question is indeed for 'mini.surround' and you try to delete tags with This is a known limitation of how 'mini.surround' and 'mini.ai' find surroundings/textobjects. They use Lua patterns which has limitations when it comes to parsing structured data. See #755 for 'mini.surround' and #735 for 'mini.ai'. The suggested solution is mentioned in the issues and is basically "use tree-sitter based specification for tag surrounding/textobject". To answer about available actions on surroundings, instead of only delete and add, these actions are available. In this particular case the closes I can suggest is to replace with interactive surrounding, but it requires typing left and right part in full. So something like this:
Another approach might be using marks and "find" action:
The second approach is a bit more complicated but probably can be automated into mapping (don't forget to set |
Beta Was this translation helpful? Give feedback.
Sorry, this is a bit confusing:
This indicates that the problem is with 'mini.ai'...
... but the chosen "Module" and this question indicate that the issue is with 'mini.surround'. I suspect the question is indeed for 'mini.surround' and you try to delete tags with
sdt. Although he answer is similar in both cases.This is a known limitation of how 'mini…