Skip to content

Commit

Permalink
refactor: move terminator to mason-core
Browse files Browse the repository at this point in the history
  • Loading branch information
williamboman committed Dec 5, 2022
1 parent 44c7daa commit 8d2997f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
6 changes: 5 additions & 1 deletion lua/mason-core/package/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,11 @@ function Package:new_handle()
local handle = InstallationHandle.new(self)
self.handle = handle

require("mason.terminator").register(handle)
-- Ideally we'd decouple this and leverage Mason's event system, but to allow loading as little as possible during
-- setup (i.e. not load modules related to Mason's event system) of the mason.nvim plugin we explicitly call into
-- terminator here.
require("mason-core.terminator").register(handle)

self:emit("handle", handle)
registry:emit("package:handle", self, handle)

Expand Down
1 change: 0 additions & 1 deletion lua/mason/terminator.lua → lua/mason-core/terminator.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
local registry = require "mason-registry"
local a = require "mason-core.async"

-- Hasta la vista, baby.
Expand Down
2 changes: 1 addition & 1 deletion lua/mason/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ local M = {}
local function setup_autocmds()
vim.api.nvim_create_autocmd("VimLeavePre", {
callback = function()
require("mason.terminator").terminate(5000)
require("mason-core.terminator").terminate(5000)
end,
once = true,
})
Expand Down

0 comments on commit 8d2997f

Please sign in to comment.