why vim script change inside visual area not work?
- by avalan_che
Say a webpage like this:
...
<div class="block">
<p>...</p>
<p>...</p>
</div>
<p>...</p>
...
I tried to add class="cls" to <p>s inside <div class="block">, so I did:
while search('div class="block"','W') 0
normal vat
'<,'>s@<p@<p class="cls"@gec
endw
but this wouldn't work as expected: those <ps outside <div class="block" got changed too. In command window these lines totally work, why not putting together?