Would you consider providing an option that would prevent autofill from breaking inside a tag, between a tag and its attributes?
For instance, if I have
<a href="https://some-long-url-that-extends-most-of-the-width-of-the-page">text|</a>
The cursor is positioned right after "text" and I type a space, with auto-fill enabled.
Web-mode turns this into:
<a
href="https://some-long-url-that-extends-most-of-the-width-of-the-page">text|
</a>
I wanted it to break after "text", not after "<a". I don't want it to break between <a and href, ever. (Often, the link is long enough that it's wider than the fill width, so breaking the line there doesn't accomplish anything useful anyway.)
I'd like to be able to prevent autofill from ever wrapping inside a tag's attributes, i.e. between < and >. But I don't want to turn off autofill entirely, because I want it when I'm typing a block of text, like inside
.
Worse, undoing this also undoes the last several words I typed, so every time this happens, I have to undo, then retype the last few words I typed.
I've tried fiddling with the various web-mode variables with names related to indenting (there aren't any that look related to filling) but none of them seem to help. If I could add the a tag to a blacklist that doesn't get auto-filled, that would be fine too (I don't really need auto-fill for link text).
The only solutions I've found are to turn off auto-fill-mode, try to remember to type Ctrl-q before every space in link text, or go back to html-mode (which doesn't have this problem and breaks where I want it to, but web-mode has so many excellent features that I want to continue using it).
Thanks for considering this request!
Would you consider providing an option that would prevent autofill from breaking inside a tag, between a tag and its attributes?
For instance, if I have
<a href="https://some-long-url-that-extends-most-of-the-width-of-the-page">text|</a>The cursor is positioned right after "text" and I type a space, with auto-fill enabled.
Web-mode turns this into:
I wanted it to break after "text", not after "<a". I don't want it to break between <a and href, ever. (Often, the link is long enough that it's wider than the fill width, so breaking the line there doesn't accomplish anything useful anyway.)
I'd like to be able to prevent autofill from ever wrapping inside a tag's attributes, i.e. between < and >. But I don't want to turn off autofill entirely, because I want it when I'm typing a block of text, like inside
.Worse, undoing this also undoes the last several words I typed, so every time this happens, I have to undo, then retype the last few words I typed.
I've tried fiddling with the various web-mode variables with names related to indenting (there aren't any that look related to filling) but none of them seem to help. If I could add the a tag to a blacklist that doesn't get auto-filled, that would be fine too (I don't really need auto-fill for link text).
The only solutions I've found are to turn off auto-fill-mode, try to remember to type Ctrl-q before every space in link text, or go back to html-mode (which doesn't have this problem and breaks where I want it to, but web-mode has so many excellent features that I want to continue using it).
Thanks for considering this request!