galaxyline.nvim icon indicating copy to clipboard operation
galaxyline.nvim copied to clipboard

"event" setting is not respected (immediately?)

Open spamwax opened this issue 2 years ago • 0 comments

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.

spamwax avatar Jul 19 '21 22:07 spamwax