Skip to content

Commit

Permalink
fix(lualine): error in vscode theme when transparent = false
Browse files Browse the repository at this point in the history
Fixes improper ternary operator in local lualine theme for vscode.nvim
where the color value for b_section backgrounds would evaluate to nil if
vscode.nvim config has `transparent = false`.
  • Loading branch information
daephx committed Mar 1, 2024
1 parent b8e95c0 commit 14b1d1b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lua/lualine/themes/vscode.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,43 +30,43 @@ end

vscode.normal = {
a = { fg = vim.o.background == "dark" and colors.bg or colors.fg, bg = colors.blue, gui = "bold" },
b = { fg = colors.blue, bg = config.opts.transparent and colors.bg2 },
b = { fg = colors.blue, bg = colors.bg2 },
c = { fg = colors.fg, bg = config.opts.transparent and "NONE" or colors.bg },
}

vscode.visual = {
a = { fg = vim.o.background == "dark" and colors.bg or colors.fg, bg = colors.yellow, gui = "bold" },
b = { fg = colors.yellow, bg = config.opts.transparent and colors.bg2 },
b = { fg = colors.yellow, bg = colors.bg2 },
c = { fg = colors.fg, bg = config.opts.transparent and "NONE" or colors.bg },
}

vscode.replace = {
a = { fg = vim.o.background == "dark" and colors.bg or colors.fg, bg = colors.red, gui = "bold" },
b = { fg = colors.red, bg = config.opts.transparent and colors.bg2 },
b = { fg = colors.red, bg = colors.bg2 },
c = { fg = colors.fg, bg = config.opts.transparent and "NONE" or colors.bg },
}

vscode.insert = {
a = { fg = vim.o.background == "dark" and colors.bg or colors.fg, bg = colors.green, gui = "bold" },
b = { fg = colors.green, bg = config.opts.transparent and colors.bg2 },
b = { fg = colors.green, bg = colors.bg2 },
c = { fg = colors.fg, bg = config.opts.transparent and "NONE" or colors.bg },
}

vscode.terminal = {
a = { fg = vim.o.background == "dark" and colors.bg or colors.fg, bg = colors.green, gui = "bold" },
b = { fg = colors.fg, bg = config.opts.transparent and colors.bg2 },
b = { fg = colors.fg, bg = colors.bg2 },
c = { fg = colors.fg, bg = config.opts.transparent and "NONE" or colors.bg },
}

vscode.command = {
a = { fg = vim.o.background == "dark" and colors.bg or colors.fg, bg = colors.pink, gui = "bold" },
b = { fg = colors.pink, bg = config.opts.transparent and colors.bg2 },
b = { fg = colors.pink, bg = colors.bg2 },
c = { fg = colors.fg, bg = config.opts.transparent and "NONE" or colors.bg },
}

vscode.inactive = {
a = { fg = colors.fg, bg = colors.bg, gui = "bold" },
b = { fg = colors.inactive, bg = config.opts.transparent and colors.bg },
b = { fg = colors.inactive, bg = colors.bg },
c = { fg = colors.inactive, bg = config.opts.transparent and "NONE" or colors.bg },
}

Expand Down

0 comments on commit 14b1d1b

Please sign in to comment.