Sunday, May 21, 2017

Re: HTML comment :join weirdness

On So, 21 Mai 2017, BPJ wrote:

> I have an HTML file with lots of pairs of lines like these:
>
> <td colspan="1" rowspan="2" title="pb">bb</td>
> <!-- pb bb -->
>
> I want to join the two lines so that the comment comes at the end of the
> preceding line so I do `:g/<!--/-1j`. It works in that the two lines are
> joined, but the `<!--` disappears so that I get
>
> <td colspan="1" rowspan="2" title="pb">bb</td> pb bb -->
> ^
> |
> Nothing here! --------------------------------+
>
> I found a workaround
>
> :g/<!-- /s//&&
> :g/<!--/-1
>
> but I can't shake the feeling that this is not correct behavior, or is it?

Please check your formatoptions setting.

Best,
Christian
--
Daseinszweck des Kindes ist es, sein eigenes Leben zu leben.
-- Alexander Sutherland Neill

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: