galaxyline.nvim
galaxyline.nvim copied to clipboard
"event" setting is not respected (immediately?)
I am trying to change the color of file name to, say, red when the buffer's text has changed:
local buffer_modified = function()
if vim.bo.modifiable then
if vim.bo.modified then
return {"#bd4747", colors.white, "bold"}
end
end
return {colors.creamydark, colors.white, "NONE"}
end
gls.left[5] = {
FileName = {
provider = {"FileName", "FileSize"},
condition = require('galaxyline.condition').buffer_not_empty,
highlight = buffer_modified,
event = "BufModifiedSet"
}
}
The filename color does not change when the text is changed, unless I create a new window which will trigger the default events
If I add BufModifiedSet
to the default events the above snippet works and color is changed immediately.