Skip to content

Commit 48bb1cc

Browse files
authored
feat(ui): add keymap setting for toggling package installation log (#1268)
Closes #1030.
1 parent bf2d253 commit 48bb1cc

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

lua/mason/settings.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ local DEFAULT_SETTINGS = {
104104
cancel_installation = "<C-c>",
105105
-- Keymap to apply language filter
106106
apply_language_filter = "<C-f>",
107+
-- Keymap to toggle viewing package installation log
108+
toggle_package_install_log = "<CR>",
107109
},
108110
},
109111
}

lua/mason/ui/components/main/package_list.lua

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ local function InstallingPackageComponent(pkg, state)
219219
Ui.Keybind(settings.current.ui.keymaps.install_package, "INSTALL_PACKAGE", pkg),
220220
Ui.CascadingStyleNode({ "INDENT" }, {
221221
Ui.HlTextNode(pkg_state.is_log_expanded and p.Bold "▼ Displaying full log" or p.muted(tail)),
222-
Ui.Keybind("<CR>", "TOGGLE_INSTALL_LOG", pkg),
222+
Ui.Keybind(settings.current.ui.keymaps.toggle_package_install_log, "TOGGLE_INSTALL_LOG", pkg),
223223
Ui.StickyCursor { id = ("%s-toggle-install-log"):format(pkg.name) },
224224
}),
225225
Ui.When(pkg_state.is_log_expanded, function()
@@ -284,7 +284,6 @@ local function Failed(state)
284284
state = state,
285285
heading = Ui.HlTextNode(p.heading "Failed"),
286286
packages = packages,
287-
---@param pkg Package
288287
list_item_renderer = InstallingPackageComponent,
289288
}
290289
end

0 commit comments

Comments
 (0)