From c81b8ac469284639a33ac62176db3a9e42387d76 Mon Sep 17 00:00:00 2001 From: Micah Halter Date: Thu, 3 Sep 2026 12:25:50 -0400 Subject: [PATCH 1/2] fix: align compatibility with Neovim 0.13 --- doc/astrotheme.txt | 2 +- lua/astrotheme/extras/lua.lua | 2 +- lua/astrotheme/extras/monkeytype.lua | 29 +++++++++++++++++++++++++++- tests/minit.lua | 5 +++++ 4 files changed, 35 insertions(+), 3 deletions(-) diff --git a/doc/astrotheme.txt b/doc/astrotheme.txt index 4ad3200..8c2e9d3 100644 --- a/doc/astrotheme.txt +++ b/doc/astrotheme.txt @@ -1,5 +1,5 @@ *astrotheme.txt* - For Neovim >= 0.9.0 Last change: 2026 August 27 + For Neovim >= 0.8.0 Last change: 2026 August 27 ============================================================================== Table of Contents *astrotheme-table-of-contents* diff --git a/lua/astrotheme/extras/lua.lua b/lua/astrotheme/extras/lua.lua index 0a22ea0..5d77996 100644 --- a/lua/astrotheme/extras/lua.lua +++ b/lua/astrotheme/extras/lua.lua @@ -10,7 +10,7 @@ function M.generate(colors, highlights) local ret = "local colors = " .. vim.inspect(colors) .. "\n\nlocal highlights = " - .. vim.inspect(vim.deepcopy(highlights, true)) + .. vim.inspect(vim.deepcopy(highlights)) .. "\n" return ret end diff --git a/lua/astrotheme/extras/monkeytype.lua b/lua/astrotheme/extras/monkeytype.lua index 92313a4..ef2cffa 100644 --- a/lua/astrotheme/extras/monkeytype.lua +++ b/lua/astrotheme/extras/monkeytype.lua @@ -2,6 +2,33 @@ local util = require "astrotheme.extras" local M = {} +local encode_base64 +if vim.base64 then + encode_base64 = vim.base64.encode +else + -- TODO: Remove this fallback when the minimum Neovim version is 0.10. + local alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" + encode_base64 = function(data) + return ( + (data:gsub(".", function(char) + local byte = char:byte() + local bits = "" + for i = 8, 1, -1 do + bits = bits .. (byte % 2 ^ i - byte % 2 ^ (i - 1) > 0 and "1" or "0") + end + return bits + end) .. "0000"):gsub("%d%d%d?%d?%d?%d?", function(bits) + if #bits < 6 then return "" end + local value = 0 + for i = 1, 6 do + value = value + (bits:sub(i, i) == "1" and 2 ^ (6 - i) or 0) + end + return alphabet:sub(value + 1, value + 1) + end) .. ({ "", "==", "=" })[#data % 3 + 1] + ) + end +end + --- @param colors AstroThemePalette function M.generate(colors) -- build the color palette @@ -19,7 +46,7 @@ function M.generate(colors) colorful_error_extra = colors.ui.red, } -- encode the palette into a base64 string for URL - monkeytype_colors.encoded = vim.base64.encode(vim.json.encode { + monkeytype_colors.encoded = encode_base64(vim.json.encode { c = { monkeytype_colors.bg, monkeytype_colors.main, diff --git a/tests/minit.lua b/tests/minit.lua index a039a08..9a728cf 100644 --- a/tests/minit.lua +++ b/tests/minit.lua @@ -1,5 +1,10 @@ #!/usr/bin/env -S nvim -l +if not vim.uv then + -- TODO: Remove this fallback when the minimum Neovim version is 0.10. + vim.uv = vim.loop +end + vim.env.LAZY_STDPATH = ".tests" load(vim.fn.system "curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua")() From f5fa7a3e39ad8da3f75a028dc84305ac1c9a5d26 Mon Sep 17 00:00:00 2001 From: Micah Halter Date: Thu, 3 Sep 2026 12:37:08 -0400 Subject: [PATCH 2/2] feat!: require Neovim 0.10 --- .github/workflows/astrotheme.yml | 4 ++-- README.md | 2 +- doc/astrotheme.txt | 4 ++-- extras/lua/astrodark.lua | 11 +---------- extras/lua/astrojupiter.lua | 11 +---------- extras/lua/astrolight.lua | 11 +---------- extras/lua/astromars.lua | 11 +---------- extras/vim/colors/astrodark.vim | 3 --- extras/vim/colors/astrojupiter.vim | 3 --- extras/vim/colors/astrolight.vim | 3 --- extras/vim/colors/astromars.vim | 3 --- lua/astrotheme/extras/lua.lua | 2 +- lua/astrotheme/extras/monkeytype.lua | 29 +--------------------------- lua/astrotheme/groups/base.lua | 3 --- lua/astrotheme/groups/treesitter.lua | 2 +- tests/minit.lua | 5 ----- 16 files changed, 12 insertions(+), 95 deletions(-) diff --git a/.github/workflows/astrotheme.yml b/.github/workflows/astrotheme.yml index e308845..dbc5bfa 100644 --- a/.github/workflows/astrotheme.yml +++ b/.github/workflows/astrotheme.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - nvim-version: ["stable", "nightly"] + nvim-version: ["v0.10.0", "stable", "nightly"] name: Test Neovim ${{ matrix.nvim-version }} steps: - uses: actions/checkout@v4 @@ -29,7 +29,7 @@ jobs: steps: - uses: actions/checkout@v4 with: - token: ${{ secrets.RELEASE_TOKEN != null && secrets.RELEASE_TOKEN || secrets.GITHUB_TOKEN }} + token: ${{ secrets.RELEASE_TOKEN || secrets.GITHUB_TOKEN }} - uses: rhysd/action-setup-vim@v1 with: neovim: true diff --git a/README.md b/README.md index 5bc6908..8ed4196 100644 --- a/README.md +++ b/README.md @@ -227,7 +227,7 @@ term.foreground ## ⚡ Requirements -- Neovim >= 0.8 +- Neovim >= 0.10 ## 🔌 Supported Plugins diff --git a/doc/astrotheme.txt b/doc/astrotheme.txt index 8c2e9d3..7c06864 100644 --- a/doc/astrotheme.txt +++ b/doc/astrotheme.txt @@ -1,5 +1,5 @@ *astrotheme.txt* - For Neovim >= 0.8.0 Last change: 2026 August 27 + For Neovim >= 0.10.0 Last change: 2026 August 27 ============================================================================== Table of Contents *astrotheme-table-of-contents* @@ -216,7 +216,7 @@ modifiable palette names ~ REQUIREMENTS *astrotheme-requirements* -- Neovim >= 0.8 +- Neovim >= 0.10 SUPPORTED PLUGINS *astrotheme-supported-plugins* diff --git a/extras/lua/astrodark.lua b/extras/lua/astrodark.lua index d21c9c1..8b42727 100644 --- a/extras/lua/astrodark.lua +++ b/extras/lua/astrodark.lua @@ -146,7 +146,7 @@ local highlights = { ["@define"] = "@keyword.directive.define", ["@diff.delta"] = "DiffChange", ["@diff.minus"] = "DiffDelete", - ["@diff.plus"] = "DiffAdded", + ["@diff.plus"] = "Added", ["@enum"] = { fg = "#4AC2B8" }, @@ -969,15 +969,9 @@ local highlights = { DiffAdd = { bg = "#354632" }, - DiffAdded = { - fg = "#87C05F" - }, DiffChange = { bg = "#4B4124" }, - DiffChanged = { - fg = "#F5983A" - }, DiffDelete = { bg = "#53373D" }, @@ -996,9 +990,6 @@ local highlights = { DiffOldFile = { fg = "#F5983A" }, - DiffRemoved = { - fg = "#FF838B" - }, DiffText = { bg = "#554824" }, diff --git a/extras/lua/astrojupiter.lua b/extras/lua/astrojupiter.lua index 067bd1b..5c43b33 100644 --- a/extras/lua/astrojupiter.lua +++ b/extras/lua/astrojupiter.lua @@ -146,7 +146,7 @@ local highlights = { ["@define"] = "@keyword.directive.define", ["@diff.delta"] = "DiffChange", ["@diff.minus"] = "DiffDelete", - ["@diff.plus"] = "DiffAdded", + ["@diff.plus"] = "Added", ["@enum"] = { fg = "#007652" }, @@ -969,15 +969,9 @@ local highlights = { DiffAdd = { bg = "#D0CFB9" }, - DiffAdded = { - fg = "#467118" - }, DiffChange = { bg = "#DFCAB3" }, - DiffChanged = { - fg = "#954D00" - }, DiffDelete = { bg = "#E7C2C0" }, @@ -996,9 +990,6 @@ local highlights = { DiffOldFile = { fg = "#954D00" }, - DiffRemoved = { - fg = "#A13F37" - }, DiffText = { bg = "#D8C2A7" }, diff --git a/extras/lua/astrolight.lua b/extras/lua/astrolight.lua index c525a15..3675ddc 100644 --- a/extras/lua/astrolight.lua +++ b/extras/lua/astrolight.lua @@ -146,7 +146,7 @@ local highlights = { ["@define"] = "@keyword.directive.define", ["@diff.delta"] = "DiffChange", ["@diff.minus"] = "DiffDelete", - ["@diff.plus"] = "DiffAdded", + ["@diff.plus"] = "Added", ["@enum"] = { fg = "#00615B" }, @@ -969,15 +969,9 @@ local highlights = { DiffAdd = { bg = "#C6D2BA" }, - DiffAdded = { - fg = "#345E00" - }, DiffChange = { bg = "#D6BAE8" }, - DiffChanged = { - fg = "#A34500" - }, DiffDelete = { bg = "#E0BABA" }, @@ -996,9 +990,6 @@ local highlights = { DiffOldFile = { fg = "#A34500" }, - DiffRemoved = { - fg = "#990000" - }, DiffText = { bg = "#CFAEE5" }, diff --git a/extras/lua/astromars.lua b/extras/lua/astromars.lua index ee19f8e..ae13326 100644 --- a/extras/lua/astromars.lua +++ b/extras/lua/astromars.lua @@ -146,7 +146,7 @@ local highlights = { ["@define"] = "@keyword.directive.define", ["@diff.delta"] = "DiffChange", ["@diff.minus"] = "DiffDelete", - ["@diff.plus"] = "DiffAdded", + ["@diff.plus"] = "Added", ["@enum"] = { fg = "#4FAD97" }, @@ -969,15 +969,9 @@ local highlights = { DiffAdd = { bg = "#383A29" }, - DiffAdded = { - fg = "#84A860" - }, DiffChange = { bg = "#473521" }, - DiffChanged = { - fg = "#EF9474" - }, DiffDelete = { bg = "#4E3134" }, @@ -996,9 +990,6 @@ local highlights = { DiffOldFile = { fg = "#EF9474" }, - DiffRemoved = { - fg = "#DF8489" - }, DiffText = { bg = "#503C22" }, diff --git a/extras/vim/colors/astrodark.vim b/extras/vim/colors/astrodark.vim index 5e9a4fc..a8db75c 100644 --- a/extras/vim/colors/astrodark.vim +++ b/extras/vim/colors/astrodark.vim @@ -29,16 +29,13 @@ hi DiagnosticUnderlineOk gui=undercurl guibg=NONE guisp=#75AD47 hi DiagnosticUnderlineWarn gui=undercurl guibg=NONE guisp=#D09214 hi DiagnosticWarn guibg=NONE guifg=#D09214 hi DiffAdd guibg=#354632 -hi DiffAdded guibg=NONE guifg=#87C05F hi DiffChange guibg=#4B4124 -hi DiffChanged guibg=NONE guifg=#F5983A hi DiffDelete guibg=#53373D hi DiffFile guibg=NONE guifg=#5EB7FF hi DiffIndexLine guibg=NONE guifg=#4AC2B8 hi DiffLine guibg=NONE guifg=#ADB0BB hi DiffNewFile guibg=NONE guifg=#87C05F hi DiffOldFile guibg=NONE guifg=#F5983A -hi DiffRemoved guibg=NONE guifg=#FF838B hi DiffText guibg=#554824 hi Directory guibg=NONE guifg=#50A4E9 hi EndOfBuffer guibg=NONE guifg=#3A3E47 diff --git a/extras/vim/colors/astrojupiter.vim b/extras/vim/colors/astrojupiter.vim index 967f6de..bb09ffd 100644 --- a/extras/vim/colors/astrojupiter.vim +++ b/extras/vim/colors/astrojupiter.vim @@ -29,16 +29,13 @@ hi DiagnosticUnderlineOk gui=undercurl guibg=NONE guisp=#569400 hi DiagnosticUnderlineWarn gui=undercurl guibg=NONE guisp=#AC7300 hi DiagnosticWarn guibg=NONE guifg=#AC7300 hi DiffAdd guibg=#D0CFB9 -hi DiffAdded guibg=NONE guifg=#467118 hi DiffChange guibg=#DFCAB3 -hi DiffChanged guibg=NONE guifg=#954D00 hi DiffDelete guibg=#E7C2C0 hi DiffFile guibg=NONE guifg=#006E89 hi DiffIndexLine guibg=NONE guifg=#007652 hi DiffLine guibg=NONE guifg=#815654 hi DiffNewFile guibg=NONE guifg=#467118 hi DiffOldFile guibg=NONE guifg=#954D00 -hi DiffRemoved guibg=NONE guifg=#A13F37 hi DiffText guibg=#D8C2A7 hi Directory guibg=NONE guifg=#0090A2 hi EndOfBuffer guibg=NONE guifg=#D0B6B6 diff --git a/extras/vim/colors/astrolight.vim b/extras/vim/colors/astrolight.vim index d1bac7c..7ddee49 100644 --- a/extras/vim/colors/astrolight.vim +++ b/extras/vim/colors/astrolight.vim @@ -29,16 +29,13 @@ hi DiagnosticUnderlineOk gui=undercurl guibg=NONE guisp=#42AD17 hi DiagnosticUnderlineWarn gui=undercurl guibg=NONE guisp=#E69400 hi DiagnosticWarn guibg=NONE guifg=#E69400 hi DiffAdd guibg=#C6D2BA -hi DiffAdded guibg=NONE guifg=#345E00 hi DiffChange guibg=#D6BAE8 -hi DiffChanged guibg=NONE guifg=#A34500 hi DiffDelete guibg=#E0BABA hi DiffFile guibg=NONE guifg=#00508A hi DiffIndexLine guibg=NONE guifg=#00615B hi DiffLine guibg=NONE guifg=#4F4F4F hi DiffNewFile guibg=NONE guifg=#345E00 hi DiffOldFile guibg=NONE guifg=#A34500 -hi DiffRemoved guibg=NONE guifg=#990000 hi DiffText guibg=#CFAEE5 hi Directory guibg=NONE guifg=#3F8CEA hi EndOfBuffer guibg=NONE guifg=#B5B9BD diff --git a/extras/vim/colors/astromars.vim b/extras/vim/colors/astromars.vim index 71d7a0c..0ec561e 100644 --- a/extras/vim/colors/astromars.vim +++ b/extras/vim/colors/astromars.vim @@ -29,16 +29,13 @@ hi DiagnosticUnderlineOk gui=undercurl guibg=NONE guisp=#9AC374 hi DiagnosticUnderlineWarn gui=undercurl guibg=NONE guisp=#FFA31A hi DiagnosticWarn guibg=NONE guifg=#FFA31A hi DiffAdd guibg=#383A29 -hi DiffAdded guibg=NONE guifg=#84A860 hi DiffChange guibg=#473521 -hi DiffChanged guibg=NONE guifg=#EF9474 hi DiffDelete guibg=#4E3134 hi DiffFile guibg=NONE guifg=#4FA9C6 hi DiffIndexLine guibg=NONE guifg=#4FAD97 hi DiffLine guibg=NONE guifg=#A5B2BC hi DiffNewFile guibg=NONE guifg=#84A860 hi DiffOldFile guibg=NONE guifg=#EF9474 -hi DiffRemoved guibg=NONE guifg=#DF8489 hi DiffText guibg=#503C22 hi Directory guibg=NONE guifg=#9CBDC9 hi EndOfBuffer guibg=NONE guifg=#393337 diff --git a/lua/astrotheme/extras/lua.lua b/lua/astrotheme/extras/lua.lua index 5d77996..0a22ea0 100644 --- a/lua/astrotheme/extras/lua.lua +++ b/lua/astrotheme/extras/lua.lua @@ -10,7 +10,7 @@ function M.generate(colors, highlights) local ret = "local colors = " .. vim.inspect(colors) .. "\n\nlocal highlights = " - .. vim.inspect(vim.deepcopy(highlights)) + .. vim.inspect(vim.deepcopy(highlights, true)) .. "\n" return ret end diff --git a/lua/astrotheme/extras/monkeytype.lua b/lua/astrotheme/extras/monkeytype.lua index ef2cffa..92313a4 100644 --- a/lua/astrotheme/extras/monkeytype.lua +++ b/lua/astrotheme/extras/monkeytype.lua @@ -2,33 +2,6 @@ local util = require "astrotheme.extras" local M = {} -local encode_base64 -if vim.base64 then - encode_base64 = vim.base64.encode -else - -- TODO: Remove this fallback when the minimum Neovim version is 0.10. - local alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" - encode_base64 = function(data) - return ( - (data:gsub(".", function(char) - local byte = char:byte() - local bits = "" - for i = 8, 1, -1 do - bits = bits .. (byte % 2 ^ i - byte % 2 ^ (i - 1) > 0 and "1" or "0") - end - return bits - end) .. "0000"):gsub("%d%d%d?%d?%d?%d?", function(bits) - if #bits < 6 then return "" end - local value = 0 - for i = 1, 6 do - value = value + (bits:sub(i, i) == "1" and 2 ^ (6 - i) or 0) - end - return alphabet:sub(value + 1, value + 1) - end) .. ({ "", "==", "=" })[#data % 3 + 1] - ) - end -end - --- @param colors AstroThemePalette function M.generate(colors) -- build the color palette @@ -46,7 +19,7 @@ function M.generate(colors) colorful_error_extra = colors.ui.red, } -- encode the palette into a base64 string for URL - monkeytype_colors.encoded = encode_base64(vim.json.encode { + monkeytype_colors.encoded = vim.base64.encode(vim.json.encode { c = { monkeytype_colors.bg, monkeytype_colors.main, diff --git a/lua/astrotheme/groups/base.lua b/lua/astrotheme/groups/base.lua index 75dea63..fe2b829 100644 --- a/lua/astrotheme/groups/base.lua +++ b/lua/astrotheme/groups/base.lua @@ -128,9 +128,6 @@ local function callback(c, opts) Added = { fg = c.syntax.green }, Removed = { fg = c.syntax.red }, Changed = { fg = c.syntax.orange }, - DiffAdded = { fg = c.syntax.green }, -- NOTE: DEPRECATED IN v0.10 - DiffRemoved = { fg = c.syntax.red }, -- NOTE: DEPRECATED IN v0.10 - DiffChanged = { fg = c.syntax.orange }, -- NOTE: DEPRECATED IN v0.10 DiffAdd = { bg = color.new(c.syntax.green):blend(base, 0.75):tohex() }, DiffChange = { bg = color.new(c.syntax.yellow):blend(base, 0.75):tohex() }, DiffDelete = { bg = color.new(c.syntax.red):blend(base, 0.75):tohex() }, diff --git a/lua/astrotheme/groups/treesitter.lua b/lua/astrotheme/groups/treesitter.lua index 0b043e0..9e38533 100644 --- a/lua/astrotheme/groups/treesitter.lua +++ b/lua/astrotheme/groups/treesitter.lua @@ -124,7 +124,7 @@ local function callback(c, opts) ["@markup.list.unchecked"] = { fg = c.ui.blue, bold = true }, ["@markup.list.checked"] = { fg = c.ui.cyan, bold = true }, - ["@diff.plus"] = "DiffAdded", + ["@diff.plus"] = "Added", ["@diff.minus"] = "DiffDelete", ["@diff.delta"] = "DiffChange", diff --git a/tests/minit.lua b/tests/minit.lua index 9a728cf..a039a08 100644 --- a/tests/minit.lua +++ b/tests/minit.lua @@ -1,10 +1,5 @@ #!/usr/bin/env -S nvim -l -if not vim.uv then - -- TODO: Remove this fallback when the minimum Neovim version is 0.10. - vim.uv = vim.loop -end - vim.env.LAZY_STDPATH = ".tests" load(vim.fn.system "curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua")()