Skip to content

Commit

Permalink
fix(scala): only initialize metals once per buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
mehalter committed May 7, 2024
1 parent a751246 commit 29ace38
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lua/astrocommunity/pack/scala/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@ return {
pattern = self.ft,
group = vim.api.nvim_create_augroup("nvim-metals", { clear = true }),
desc = "Initialize and attach nvim-metals",
callback = function() require("metals").initialize_or_attach(opts) end,
callback = function(args)
if not vim.b[args.buf].metals_initialized then
require("metals").initialize_or_attach(opts)
vim.b[args.buf].metals_initialized = true
end
end,
})
end,
},
Expand Down

0 comments on commit 29ace38

Please sign in to comment.