Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix: when launched first time lazy covers mason nvim window #51
  • Loading branch information
s1n7ax committed Dec 7, 2023
commit 5f2087b655abc1f3991c2ab77084ed32e35ba510
5 changes: 5 additions & 0 deletions lua/java/startup/mason-dep.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ local mason_ui = require('mason.ui')
local mason_util = require('java.utils.mason')
local notify = require('java-core.utils.notify')
local async = require('java-core.utils.async')
local lazy = require('java.ui.lazy')
local sync = async.sync

local M = {}
Expand All @@ -29,6 +30,10 @@ end

function M.refresh_and_install(packages)
vim.schedule(function()
-- lazy covers mason
-- https://github.com/nvim-java/nvim-java/issues/51
lazy.close_lazy_if_opened()

mason_ui.open()
notify.warn('Please close and re-open after dependecies are installed')
end)
Expand Down
13 changes: 13 additions & 0 deletions lua/java/ui/lazy.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
local M = {}

function M.close_lazy_if_opened()
local ok, view = pcall(require, 'lazy.view')

if not ok then
return
end

view.view:hide()
end

return M