heybourn / headwind

An opinionated Tailwind CSS class sorter built for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=heybourn.headwind
MIT License
1.38k stars 46 forks source link

Preserve line breaks #46

Open gary149 opened 4 years ago

gary149 commented 4 years ago

It would be nice to preserve line-breaks when formatting with headwind - I use prettier line limit and headwind will inline everything on save.

With prettier format:

image

With the same prettier config and headwind:

image

edit: the real solution may be to run headwind before prettier.

awinecki commented 3 years ago

Coming from VIM world (https://github.com/iamcco/coc-tailwindcss, https://github.com/neoclide/coc.nvim), I would like this behaviour as well.

Currently I work on a small project and when prototyping quickly with Tailwind, you end up with lots of classes. It's great to have the auto sorting in place because scanning such strings is more predictable. But if you still want to use split views for 80-120 line length, you need to constantly check things outside the screen.

Option like headwind.preserveLineBreaks would be ideal.

nj-screenshot 2021-01-10 at 18 12 47@2x

Text wrapping solves this; but it's not ideal – some lines can be long e.g. URLs.