goolord / alpha-nvim

a lua powered greeter like vim-startify / dashboard-nvim
MIT License
1.82k stars 109 forks source link

redrawing does nothing #293

Open greyHairChooseLife opened 1 month ago

greyHairChooseLife commented 1 month ago

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:

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
```lua
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