Skip to content
This repository has been archived by the owner on Jan 2, 2023. It is now read-only.

fix: plugin not work when colors are more than termcolors #137

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions lua/rainbow/internal.lua
Original file line number Diff line number Diff line change
Expand Up @@ -156,14 +156,9 @@ local M = {}

--- Define highlight groups. This had to be a function to allow an autocmd doing this at colorscheme change.
function M.defhl()
local set_hl = vim.api.nvim_set_hl
for i = 1, #colors do
local s = string.format(
"highlight default rainbowcol%d guifg=%s ctermfg=%s",
i,
colors[i],
termcolors[i]
)
vim.cmd(s)
set_hl(0, 'rainbowcol' .. i, { fg = colors[i], ctermfg = termcolors[i] })
end
end

Expand Down