You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm experimenting with the slanted gaps example and I've got the separators generated by the process_sections function to be colored like I want in normal mode, but I'd like the separators to change color when the mode changes. I have the following code which grabs the correct color from my theme per mode like so:
localmode_colors=require"lualine.themes.ayu"-- Put proper separators and gaps between components in sectionslocalfunctionprocess_sections(sections)
forname, sectioninpairs(sections) dolocalleft=name:sub(9, 10) <"x"forpos=1, name~="lualine_z" and#sectionor#section-2doprint"attempting mode change refresh"localmode=string.lower(require("lualine.utils.mode").get_mode())
localbg=mode_colors[mode].a.bgtable.insert(section, pos*2, { empty, color= { fg=colors.white, bg=bg } })
endforid, compinipairs(section) doiftype(comp) ~="table" thencomp= { comp }
section[id] =compendcomp.separator=leftand { right="" } or { left="" }
endendreturnsectionsend
but this function seemingly never gets called again after the initial render. I also added an autocmd to try to force a refresh, but that doesn't seem to help either.
-- Add autocommand for ModeChanged to trigger redrawstatusvim.api.nvim_create_autocmd("ModeChanged", {
callback=function(c)
require("lualine").refresh { scope="all" }
end,
})
Is there something obvious I'm missing? I'd appreciate any help! My full lualine.lua plugin file is like so:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm experimenting with the slanted gaps example and I've got the separators generated by the
process_sections
function to be colored like I want in normal mode, but I'd like the separators to change color when the mode changes. I have the following code which grabs the correct color from my theme per mode like so:but this function seemingly never gets called again after the initial render. I also added an autocmd to try to force a refresh, but that doesn't seem to help either.
Is there something obvious I'm missing? I'd appreciate any help! My full
lualine.lua
plugin file is like so:Beta Was this translation helpful? Give feedback.
All reactions