Skip to content

Multiple update events with custom patterns #220

@lopi-py

Description

@lopi-py

Hello! I have a git branch component and ideally I would update it on User GitSignsUpdate and ModeChanged as the foreground color is the vi mode color. I can't set update to both events as the former is an user autocmd and the later is a builtin autocmd (ModeChanged will not be fired with GitSignsUpdate pattern).

local GitBranch = {
  condition = conditions.is_git_repo,
  -- TODO: clear cache with ModeChanged event
  -- update = { "User", pattern = "GitSignsUpdate" },
  provider = function()
    return vim.b.gitsigns_head
  end,
  hl = function(self)
    return { fg = self:mode_color(), bold = true }
  end,
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions