formatter: reenable trailing whitespaces
This commit is contained in:
parent
722dbbbf40
commit
92f6f79316
1 changed files with 7 additions and 1 deletions
8
init.lua
8
init.lua
|
|
@ -124,7 +124,13 @@ formatter.setup({
|
||||||
require("formatter.filetypes.lua").stylua,
|
require("formatter.filetypes.lua").stylua,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
["*"] = {
|
||||||
|
-- "formatter.filetypes.any" defines default configurations for any
|
||||||
|
-- filetype
|
||||||
|
require("formatter.filetypes.any").remove_trailing_whitespace
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
---- LSP ----
|
---- LSP ----
|
||||||
local lsp = require("lspconfig")
|
local lsp = require("lspconfig")
|
||||||
|
|
||||||
|
|
@ -183,7 +189,7 @@ local servers = {
|
||||||
vim.api.nvim_create_autocmd({ "BufWritePre" }, {
|
vim.api.nvim_create_autocmd({ "BufWritePre" }, {
|
||||||
callback = function()
|
callback = function()
|
||||||
local lsp_format = false
|
local lsp_format = false
|
||||||
for _, client in pairs(vim.lsp.get_active_clients({ bufnr = 0 })) do
|
for _, client in pairs(vim.lsp.buf_get_clients()) do
|
||||||
if client.server_capabilities.documentFormattingProvider then
|
if client.server_capabilities.documentFormattingProvider then
|
||||||
lsp_format = true
|
lsp_format = true
|
||||||
break
|
break
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue