diff options
| author | William Boman <william@redwill.se> | 2025-04-21 21:17:45 +0200 |
|---|---|---|
| committer | William Boman <william@redwill.se> | 2025-04-21 21:18:28 +0200 |
| commit | 130936b87368e2c37cec013f69b1aa94c6f2fd20 (patch) | |
| tree | 724e4dd808615e0b2d632ca5c7b8b9ec45450751 | |
| parent | fix(ui): fix setting outdated package state (diff) | |
| download | mason-130936b87368e2c37cec013f69b1aa94c6f2fd20.tar mason-130936b87368e2c37cec013f69b1aa94c6f2fd20.tar.gz mason-130936b87368e2c37cec013f69b1aa94c6f2fd20.tar.bz2 mason-130936b87368e2c37cec013f69b1aa94c6f2fd20.tar.lz mason-130936b87368e2c37cec013f69b1aa94c6f2fd20.tar.xz mason-130936b87368e2c37cec013f69b1aa94c6f2fd20.tar.zst mason-130936b87368e2c37cec013f69b1aa94c6f2fd20.zip | |
feat(ui): display current version in header
| -rw-r--r-- | lua/mason/ui/components/header.lua | 3 | ||||
| -rw-r--r-- | tests/mason-registry/registry_spec.lua | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/lua/mason/ui/components/header.lua b/lua/mason/ui/components/header.lua index 1e5b2f10..0c9ba50a 100644 --- a/lua/mason/ui/components/header.lua +++ b/lua/mason/ui/components/header.lua @@ -2,6 +2,7 @@ local Ui = require "mason-core.ui" local _ = require "mason-core.functional" local p = require "mason.ui.palette" local settings = require "mason.settings" +local version = require "mason.version" ---@param state InstallerUiState return function(state) @@ -12,9 +13,11 @@ return function(state) Ui.HlTextNode { Ui.When(state.view.is_showing_help, { p.header_secondary(" " .. state.header.title_prefix .. " mason.nvim "), + p.header_secondary(version.VERSION .. " "), p.none((" "):rep(#state.header.title_prefix + 1)), }, { p.header " mason.nvim ", + p.header(version.VERSION .. " "), state.view.is_searching and p.Comment " (search mode, press <Esc> to clear)" or p.none "", }), Ui.When(state.view.is_showing_help, { diff --git a/tests/mason-registry/registry_spec.lua b/tests/mason-registry/registry_spec.lua index 35c37853..89b9436f 100644 --- a/tests/mason-registry/registry_spec.lua +++ b/tests/mason-registry/registry_spec.lua @@ -1,6 +1,6 @@ local Pkg = require "mason-core.package" -local test_helpers = require "mason-test.helpers" local registry = require "mason-registry" +local test_helpers = require "mason-test.helpers" describe("mason-registry", function() it("should return package", function() @@ -23,7 +23,7 @@ describe("mason-registry", function() assert.equals(3, #registry.get_all_package_specs()) end) - it("should check if package is installed", function () + it("should check if package is installed", function() local dummy = registry.get_package "dummy" assert.is_false(registry.is_installed "dummy") test_helpers.sync_install(dummy) |
