Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add setting to hide the UI header #1647

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 3 additions & 0 deletions lua/mason/settings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ local DEFAULT_SETTINGS = {
-- - Float in the range of 0-1 for a percentage of screen height.
height = 0.9,

-- Whether to show the header.
show_header = true,

icons = {
---@since 1.0.0
-- The list icon to use for installed packages.
Expand Down
12 changes: 8 additions & 4 deletions lua/mason/ui/components/header.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ local settings = require "mason.settings"
---@param state InstallerUiState
return function(state)
local uninstalled_registries = _.filter(_.prop_eq("is_installed", false), state.info.registries)

return Ui.Node {
Ui.CascadingStyleNode({ "CENTERED" }, {
local header = Ui.EmptyLine()
if settings.current.ui.show_header then
header = Ui.CascadingStyleNode({ "CENTERED" }, {
Ui.HlTextNode {
Ui.When(state.view.is_showing_help, {
p.header_secondary(" " .. state.header.title_prefix .. " mason.nvim "),
Expand All @@ -28,7 +28,11 @@ return function(state)
}),
{ p.Comment "https://github.com/williamboman/mason.nvim" },
},
}),
})
end

return Ui.Node {
header,
Ui.When(not state.packages.new_versions_check.is_checking and #uninstalled_registries > 0, function()
return Ui.CascadingStyleNode({ "INDENT" }, {
Ui.EmptyLine(),
Expand Down