zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
46.94k stars 2.7k forks source link

Emmet puts all elements in one line #15695

Open axoking opened 1 month ago

axoking commented 1 month ago

Check for existing issues

Describe the bug / provide steps to reproduce it

Some emmet snippets appear with all the elements in one line instead of having line breaks

Like

div>span*3

gives me

<div><span></span><span></span><span></span></div>

instead of

<div>
    <span></span>
    <span></span>
    <span></span>
</div>

Environment

Zed: v0.146.4 (Zed) OS: macOS 15.0.0 Memory: 8 GiB Architecture: aarch64

If applicable, add mockups / screenshots to help explain present your vision of the feature

No response

If applicable, attach your Zed.log file to this issue.

Zed.log


JosephTLyons commented 1 month ago

@axoking, which editor are you using in which it autoformats the output? I tested in VS Code:

div>span*3 -> <div><span></span><span></span><span></span></div>

SCR-20240802-mawj

I'm not a frontend dev, and I think my settings in VS Code are stock.

axoking commented 1 month ago

Um, actually that's my first time using Emmet Snippets, but in every demonstration I saw it put the code in separate lines. It also sometimes does this with other prompts, like div>div*3. I don't know if that's a bug or intented to be but it really doesn't look correct if everything is in one line...

Edit: Ok I looked it up and it seems like Emmet should give every element a new line when it's 3 or more elements (see https://docs.emmet.io/customization/syntax-profiles/). At least the default value is 3. But I think Zed should be using the default values as there's no option to change Emmet settings. So that indeed seems to be a bug or something.

JosephTLyons commented 1 month ago

cc: @osiewicz