Closed Liz-Lovelace closed 3 months ago
cc: @osiewicz - I think this used to work, maybe some sort of a regression?
No, disabling it is possible; it's not use_autoclose
though; the tag closing comes from language server, so you have to disable it via:
"lsp": {
"vscode-html-language-server": {
"settings": {
"html": { "tagAutoclosing": false }
}
}
}
Admittedly, we may want to link one to the other; if user does have "use_autoclose` set to false and they don't have an explicit setting for vsc, we could disable it for them. I think it deserves a separate ticket though.
Oh, thanks, that solves it! Would be nice if it was documented somewhere obvious, I couldn't find this option after quite a bit of googling ^_^
Does the solution form @osiewicz apply to empty tags like <br>
as well? I added the mentioned snippet to my settings, which now looks like this:
{
"ui_font_size": 16,
"buffer_font_size": 16,
"theme": {
"mode": "system",
"light": "Ayu Mirage",
"dark": "One Dark"
},
"preferred_line_length": 80,
"tab_size": 2,
"lsp": {
"vscode-html-language-server": {
"settings": {
"html": { "tagAutoclosing": false }
}
}
}
}
However, when saving my HTML file, it still changes <br>
tags to <br />
, even after restarting Zed. I'm using Zed 0.144.4 on Linux.
@tenry92 I believe that HTML language server is formatting your code and closing <br>
. Can you try disabling format_on_save
for HTML and see how it goes?
Hi @osiewicz! Adding "format_on_save": "off"
to my settings actually disables that behavior. On the downside it obviously disables the formatting completely, which is not what I'm looking for.
I totally get that; it's just that the closing /
is added automatically by the language server, which is not something we can remedy on the side of Zed itself. We could look into configuring it so that br
is on a list of tags excluded from autoformat (which looks to be controlled by html.format.unformatted
setting from this site)
Check for existing issues
Describe the feature
When I open an
.html
file and type<div>
, I don't want the editor to insert</div>
after my cursorI have tried setting
use_autoclose
tofalse
, and it didn't helpI'm a bit crazy about my editor changing the file without my explicit command, so I'd really appreciate if an option was added to disable HTML tag auto-closing, thanks!
If applicable, add mockups / screenshots to help present your vision of the feature
No response