Skip to content

redrawing does nothing #293

@greyHairChooseLife

Description

@greyHairChooseLife

Hi there,

For the most, thank you for your cool plugin.

Here is a difficulty what I am facing.

I just can't redraw after calling some actions.

I tried as follow:

  • to get header data
local alpha = require("alpha")
local dashboard = require("alpha.themes.dashboard")

local function header()
  local fetch_output = vim.fn.system('git log --oneline HEAD..FETCH_HEAD')
  local fetch_lines = {}
  for line in fetch_output:gmatch("([^\n]*)\n?") do
    table.insert(fetch_lines, line)
  end

  local result = {
    "   " .. cwd,
    " HEAD..FETCH_HEAD       ",
    " ",
  }

  for _, line in ipairs(fetch_lines) do
    table.insert(result, "  " .. line)
  end
end
  • to make it work with button
dashboard.section.buttons.val = {
  dashboard.button("fe", "                           -  fetch   ", function()
    vim.cmd('Git fetch')
    alpha.redraw()
  end),

Fetching completes well with vim-fugitive, but it doesn't redraw the output. I am sure this comes from my dumbness but would you please help me? It is hard for me to make it even with your clean help docs.


And one more thing, I couldn't get it what it means exactly but I tried this below, that didn't help nothing.

dashboard.section.header.opts.redraw = true
dashboard.section.buttons.opts.redraw = true

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