Skip to content

Commit f565cf1

Browse files
committed
feat: Backport nvim-lua#1395
Signed-off-by: Michal Drla <michal.drla@outlook.com>
1 parent da0cf40 commit f565cf1

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

lua/default/plugins/autoformat.lua

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,20 @@ return {
2222
local disable_filetypes = { c = true, cpp = true }
2323
local lsp_format_opt
2424
if disable_filetypes[vim.bo[bufnr].filetype] then
25-
lsp_format_opt = 'never'
25+
-- lsp_format_opt = 'never'
26+
-- Configuration taken from https://github.com/nvim-lua/kickstart.nvim/pull/1395
27+
return nil
2628
else
27-
lsp_format_opt = 'fallback'
29+
-- lsp_format_opt = 'fallback'
30+
return {
31+
timeout_ms = 500,
32+
lsp_format = 'fallback',
33+
}
2834
end
29-
return {
30-
timeout_ms = 500,
31-
lsp_format = lsp_format_opt,
32-
}
35+
-- return {
36+
-- timeout_ms = 500,
37+
-- lsp_format = lsp_format_opt,
38+
-- }
3339
end,
3440
formatters_by_ft = {
3541
lua = { 'stylua' },

0 commit comments

Comments
 (0)