From e7b755d869296c0e100add9c940fb3024a41aa8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ellison=20Lea=CC=83o?= Date: Fri, 29 Sep 2023 18:27:57 -0300 Subject: BREAKING CHANGE: gruvbox is now a single module palette: Can now be accessed in the main module through `require('gruvbox').palette` get_base_colors: now a internal function called get_colors. If you want to get the colors, just get the palette directly groups: now moved to main module --- tests/gruvbox/gruvbox_spec.lua | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/gruvbox/gruvbox_spec.lua b/tests/gruvbox/gruvbox_spec.lua index 387a034..e4db89f 100644 --- a/tests/gruvbox/gruvbox_spec.lua +++ b/tests/gruvbox/gruvbox_spec.lua @@ -137,10 +137,8 @@ describe("tests", function() it("does not set terminal colors when terminal_colors is false", function() clear_term_colors() - print("vim.g color before =>", vim.g.terminal_color_0, type(vim.g.terminal_color_0)) gruvbox.setup({ terminal_colors = false }) gruvbox.load() - print("vim.g color after =>", vim.g.terminal_color_0, type(vim.g.terminal_color_0)) assert.is_nil(vim.g.terminal_color_0) end) @@ -148,7 +146,16 @@ describe("tests", function() clear_term_colors() gruvbox.setup({ terminal_colors = true }) gruvbox.load() - local colors = require("gruvbox.palette").get_base_colors({}, "dark", "") - assert.are.same(vim.g.terminal_color_0, colors.bg0) + + -- dark bg + local colors = require("gruvbox").palette + vim.opt.background = "dark" + assert.are.same(vim.g.terminal_color_0, colors.dark0) + + -- light bg + clear_term_colors() + gruvbox.load() + vim.opt.background = "light" + assert.are.same(vim.g.terminal_color_0, colors.light0) end) end) -- cgit v1.2.3