From 48bb1cc33a1fefe94f5ce4972446a1c6ad849f15 Mon Sep 17 00:00:00 2001 From: William Boman Date: Fri, 28 Apr 2023 12:10:24 +0200 Subject: feat(ui): add keymap setting for toggling package installation log (#1268) Closes #1030. --- lua/mason/settings.lua | 2 ++ lua/mason/ui/components/main/package_list.lua | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'lua') diff --git a/lua/mason/settings.lua b/lua/mason/settings.lua index 9ce965ea..2409615e 100644 --- a/lua/mason/settings.lua +++ b/lua/mason/settings.lua @@ -104,6 +104,8 @@ local DEFAULT_SETTINGS = { cancel_installation = "", -- Keymap to apply language filter apply_language_filter = "", + -- Keymap to toggle viewing package installation log + toggle_package_install_log = "", }, }, } diff --git a/lua/mason/ui/components/main/package_list.lua b/lua/mason/ui/components/main/package_list.lua index b0f633e6..55a0fd3d 100644 --- a/lua/mason/ui/components/main/package_list.lua +++ b/lua/mason/ui/components/main/package_list.lua @@ -219,7 +219,7 @@ local function InstallingPackageComponent(pkg, state) Ui.Keybind(settings.current.ui.keymaps.install_package, "INSTALL_PACKAGE", pkg), Ui.CascadingStyleNode({ "INDENT" }, { Ui.HlTextNode(pkg_state.is_log_expanded and p.Bold "▼ Displaying full log" or p.muted(tail)), - Ui.Keybind("", "TOGGLE_INSTALL_LOG", pkg), + Ui.Keybind(settings.current.ui.keymaps.toggle_package_install_log, "TOGGLE_INSTALL_LOG", pkg), Ui.StickyCursor { id = ("%s-toggle-install-log"):format(pkg.name) }, }), Ui.When(pkg_state.is_log_expanded, function() @@ -284,7 +284,6 @@ local function Failed(state) state = state, heading = Ui.HlTextNode(p.heading "Failed"), packages = packages, - ---@param pkg Package list_item_renderer = InstallingPackageComponent, } end -- cgit v1.2.3-70-g09d2