Fix templ file formatting

This commit is contained in:
Noah Håkansson 2024-03-03 14:44:37 +01:00
parent 1f1673571b
commit 36a671f221
2 changed files with 8 additions and 1 deletions

View file

@ -65,6 +65,13 @@ return {
return
end
-- Go Templ formatting
-- If filetype is templ, then we need to use the templ LSP client to format
-- So we disable the html client formatting capabilities
if vim.bo.filetype == 'templ' and client.name == 'html' then
client.server_capabilities.documentFormattingProvider = false
end
-- Create an autocmd that will run *before* we save the buffer.
-- Run the formatting command for the LSP that has just attached.
vim.api.nvim_create_autocmd('BufWritePre', {