fix luasnip creating statusline errors (#250)

This commit is contained in:
siduck76 2021-08-14 22:35:10 +05:30
parent 05e587cfc0
commit ebdcd4cae1
1 changed files with 14 additions and 18 deletions

View File

@ -156,25 +156,21 @@ gls.right[3] = {
} }
} }
local active_mode = { local mode_colors = {
n = {"Normal", colors.red}, [110] = {"NORMAL", colors.red},
i = {"Insert", colors.dark_purple}, [105] = {"INSERT", colors.dark_purple},
c = {"Command", colors.pink}, [99] = {"COMMAND", colors.pink},
V = {"Visual", colors.cyan}, [116] = {"TERMINAL", colors.green},
[""] = {"Visual", colors.cyan}, [118] = {"VISUAL", colors.cyan},
v = {"Visual", colors.cyan}, [22] = {"V-BLOCK", colors.cyan},
R = {"Replace", colors.orange}, [86] = {"V_LINE", colors.cyan},
t = {"Terminal", colors.green} [82] = {"REPLACE", colors.orange},
[115] = {"SELECT", colors.nord_blue},
[83] = {"S-LINE", colors.nord_blue}
} }
local function mode(m) local mode = function(n)
local chad_mode = active_mode[vim.fn.mode()][m] return mode_colors[vim.fn.mode():byte()][n]
if chad_mode == "nil" then
return active_mode[vim.fn.mode()]["t"]
else
return chad_mode
end
end end
gls.right[4] = { gls.right[4] = {
@ -205,7 +201,7 @@ gls.right[6] = {
vim.cmd("hi GalaxyViMode guifg=" .. mode(2)) vim.cmd("hi GalaxyViMode guifg=" .. mode(2))
return " " .. mode(1) .. " " return " " .. mode(1) .. " "
end, end,
highlight = {"GalaxyViMode", colors.lightbg} -- colors.red here will be overriden many times highlight = {"GalaxyViMode", colors.lightbg}
} }
} }