Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

redrawing does nothing #293

Open
greyHairChooseLife opened this issue Aug 4, 2024 · 0 comments
Open

redrawing does nothing #293

greyHairChooseLife opened this issue Aug 4, 2024 · 0 comments

Comments

@greyHairChooseLife
Copy link

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant