Skip to content

Commit

Permalink
fix: broken commit (#120)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoshihou514 authored Nov 22, 2023
1 parent a5f6fb9 commit 6c27cc4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions lua/guard/events.lua
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,17 @@ local function create_lspattach_autocmd()
if not (ft_handler[ft] and ft_handler[ft].formatter) then
ft_handler(ft):fmt('lsp')
end
if
fmt_on_save
and #api.nvim_get_autocmds({
group = group,
event = 'FileType',
pattern = ft,
})
== 0
then
format.attach_to_buf(args.buf)
end
end,
})
end
Expand Down
2 changes: 1 addition & 1 deletion lua/guard/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ local function setup(opt)
resolve_multi_ft()

if opt.lsp_as_default_formatter then
events.create_lspattach_autocmd()
events.create_lspattach_autocmd(opt.fmt_on_save)
end

local lint = require('guard.lint')
Expand Down

0 comments on commit 6c27cc4

Please sign in to comment.