Skip to content

Commit 340cad5

Browse files
authored
fix: when launched first time lazy covers mason nvim window (#52)
* fix: missing dep in readme * fix: when launched first time lazy covers mason nvim window #51
1 parent 2f3984d commit 340cad5

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ return {
4848
'nvim-java/lua-async-await',
4949
'nvim-java/nvim-java-core',
5050
'nvim-java/nvim-java-test',
51+
'nvim-java/nvim-java-dap',
5152
'MunifTanjim/nui.nvim',
5253
'neovim/nvim-lspconfig',
5354
'mfussenegger/nvim-dap',

lua/java/startup/mason-dep.lua

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ local mason_ui = require('mason.ui')
33
local mason_util = require('java.utils.mason')
44
local notify = require('java-core.utils.notify')
55
local async = require('java-core.utils.async')
6+
local lazy = require('java.ui.lazy')
67
local sync = async.sync
78

89
local M = {}
@@ -29,6 +30,10 @@ end
2930

3031
function M.refresh_and_install(packages)
3132
vim.schedule(function()
33+
-- lazy covers mason
34+
-- https://github.com/nvim-java/nvim-java/issues/51
35+
lazy.close_lazy_if_opened()
36+
3237
mason_ui.open()
3338
notify.warn('Please close and re-open after dependecies are installed')
3439
end)

lua/java/ui/lazy.lua

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
local M = {}
2+
3+
function M.close_lazy_if_opened()
4+
local ok, view = pcall(require, 'lazy.view')
5+
6+
if not ok then
7+
return
8+
end
9+
10+
view.view:hide()
11+
end
12+
13+
return M

0 commit comments

Comments
 (0)