Skip to content

Commit

Permalink
Merge pull request #36 from lukas-reineke/develop
Browse files Browse the repository at this point in the history
Version 2.3.1
  • Loading branch information
lukas-reineke authored Apr 19, 2022
2 parents f56ad1b + 0814074 commit 458fa95
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
5 changes: 4 additions & 1 deletion doc/format.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


Author: Lukas Reineke <lukas@reineke.jp>
Version: 2.3.0
Version: 2.3.1

==============================================================================
CONTENTS *lsp-format*
Expand Down Expand Up @@ -121,6 +121,9 @@ sync *lsp-format-sync*
==============================================================================
5. CHANGELOG *lsp-format-changelog*

2.3.1
Fix clear autogroup only for buffer

2.3.0
Add `sync` option
Fix overwriting global format options from command
Expand Down
8 changes: 7 additions & 1 deletion lua/lsp-format/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,14 @@ M.on_attach = function(client)
event = "BufWritePre"
end

local group = vim.api.nvim_create_augroup("Format", { clear = false })

vim.api.nvim_clear_autocmds {
buffer = bufnr,
group = group,
}
vim.api.nvim_create_autocmd(event, {
group = vim.api.nvim_create_augroup("Format", {}),
group = group,
desc = "format on save",
pattern = "<buffer>",
callback = M.format,
Expand Down

0 comments on commit 458fa95

Please sign in to comment.