From 8757a6c2283a6bc0630a0c0e649d660e768cf3b0 Mon Sep 17 00:00:00 2001 From: Iron-E Date: Tue, 26 Jan 2021 12:37:13 -0500 Subject: [PATCH] fix(highlite): `:terminal` shows wrong colors This was caused by the index of `vim.g.terminal_color_X` beginning at 1 rather than 0. I thought initially that this would be translated by the Lua metatable but I guess not! CLOSES #8 --- lua/highlite.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/highlite.lua b/lua/highlite.lua index 44699fb..77735d9 100644 --- a/lua/highlite.lua +++ b/lua/highlite.lua @@ -153,8 +153,8 @@ function highlite.highlight(highlight_group, attributes) -- {{{ † end --}}} ‡ function highlite:highlight_terminal(terminal_ansi_colors) - for index, color in ipairs(terminal_ansi_colors) do - vim.g['terminal_color_'..index] = vim.o.termguicolors and color[_PALETTE_HEX] or color[_PALETTE_256] or get(color, _PALETTE_ANSI) + for index, color in ipairs(terminal_ansi_colors) do vim.g['terminal_color_'..(index-1)] = + vim.o.termguicolors and color[_PALETTE_HEX] or color[_PALETTE_256] or get(color, _PALETTE_ANSI) end end