Closed horseinthesky closed 3 years ago
default support link to exist highlight group.
default support link to exist highlight group.
I'm afraid I don't understand.
Okay .what do you want? use exist highlight group right?
I got errors pretty much everywhere with this bug.
I don't understand what highlight group galaxyline is trying to link but since it (group) has some settings, NVIM won't allow that.
It can be fixed by adding !
to the highlight
command but as I said since I don't know what group it is trying to link I also don't know if it is a good idea to fix it this way.
no worry can you provide a min config ?
no worry can you provide a min config ?
This is my super simplified statusline
local gl = require 'galaxyline'
local gls = gl.section
local icons = {
locker = "", -- f023
not_modifiable = "", -- f05e
pencil = "", -- f040
}
-- Gruvbox
local colors = {
bg0_h = "#1d2021",
bg0 = "#282828",
bg1 = "#3c3836",
bg2 = "#504945",
bg3 = "#665c54",
bg4 = "#7c6f64",
gray = "#928374",
fg0 = "#fbf1c7",
fg1 = "#ebdbb2",
fg2 = "#d5c4a1",
fg3 = "#bdae93",
fg4 = "#a89984",
bright_red = "#fb4934",
bright_green = "#b8bb26",
bright_yellow = "#fabd2f",
bright_blue = "#83a598",
bright_purple = "#d3869b",
bright_aqua = "#8ec07c",
bright_orange = "#fe8019",
neutral_red = "#cc241d",
neutral_green = "#98971a",
neutral_yellow = "#d79921",
neutral_blue = "#458588",
neutral_purple = "#b16286",
neutral_aqua = "#689d6a",
neutral_orange = "#d65d0e",
faded_red = "#9d0006",
faded_green = "#79740e",
faded_yellow = "#b57614",
faded_blue = "#076678",
faded_purple = "#8f3f71",
faded_aqua = "#427b58",
faded_orange = "#af3a03"
}
local mode_map = {
['n'] = {'NORMAL', colors.fg3, colors.bg2},
-- ['n'] = {'NORMAL', colors.bright_green, colors.faded_green},
['i'] = {'INSERT', colors.bright_blue, colors.faded_blue},
['R'] = {'REPLACE', colors.bright_red, colors.faded_red},
['v'] = {'VISUAL', colors.bright_orange, colors.faded_orange},
['V'] = {'V-LINE', colors.bright_orange, colors.faded_orange},
['c'] = {'COMMAND', colors.bright_yellow, colors.faded_yellow},
['s'] = {'SELECT', colors.bright_orange, colors.faded_orange},
['S'] = {'S-LINE', colors.bright_orange, colors.faded_orange},
['t'] = {'TERMINAL', colors.bright_aqua, colors.faded_aqua},
[''] = {'V-BLOCK', colors.bright_orange, colors.faded_orange},
[''] = {'S-BLOCK', colors.bright_orange, colors.faded_orange},
['Rv'] = {'VIRTUAL'},
['rm'] = {'--MORE'},
}
local function mode_hl()
local mode = mode_map[vim.fn.mode()]
if mode == nil then
mode = mode_map['v']
return {'V-BLOCK', mode[2], mode[3]}
end
return mode
end
local function highlight(group, fg, bg, gui)
local cmd = string.format('highlight %s guifg=%s guibg=%s', group, fg, bg)
if gui ~= nil then cmd = cmd .. ' gui=' .. gui end
vim.cmd(cmd)
end
local function buffer_not_empty()
if vim.fn.empty(vim.fn.expand('%:t')) ~= 1 then return true end
return false
end
local function wide_enough(width)
if vim.fn.winwidth(0) > width then return true end
return false
end
gls.left[2] = {
ViMode = {
provider = function()
local label, fg, nested_fg = unpack(mode_hl())
highlight('GalaxyViMode', nested_fg, fg)
highlight('GalaxyViModeInv', fg, nested_fg)
highlight('GalaxyViModeNested', fg, nested_fg)
highlight('GalaxyViModeInvNested', nested_fg, colors.bg1)
return string.format(' %s ', label)
end,
}
}
gls.left[4] = {
FileName = {
provider = function()
if vim.bo.buftype == 'terminal' then return '' end
if not buffer_not_empty() then return '' end
local fname
if wide_enough(120) then
fname = vim.fn.fnamemodify(vim.fn.expand('%'), ':~:.')
if #fname > 35 then fname = vim.fn.expand '%:t' end
else
fname = vim.fn.expand '%:t'
end
if #fname == 0 then return '' end
if vim.bo.readonly then fname = fname .. ' ' .. icons.locker end
if not vim.bo.modifiable then fname = fname .. ' ' .. icons.not_modifiable end
if vim.bo.modified then fname = fname .. ' ' .. icons.pencil end
return ' ' .. fname .. ' '
end,
highlight = 'GalaxyViModeNested',
condition = buffer_not_empty,
}
}
use highlight!
can work. fixed
Thank you.
After the last update a lot of action start raising the following error:
It can be fixed by changing
to
on 43 of colors.lua
But I'm not sure if it is a good solution.