goolord / alpha-nvim

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

Terminal Header overlapping recent files #193

Closed dwijesinghe closed 1 year ago

dwijesinghe commented 1 year ago

Hi,

Love this plugin :) I've been working on customizing my alpha config to show an ASCII version of the Neovim logo using ascii-image-converter and my recent files. However I think I might be misunderstanding how to configure the alpha layout properly. Here's the alpha portion of my config.lua:

local alpha = require("alpha")
local alpha_theme = require("alpha.themes.theta")
require("alpha.term")

local alpha_header = {
    type = "terminal",
    command = "cat | ascii-image-converter --color " .. os.getenv("HOME") .. "/Code/neovim_logo_cropped.png -W 40",
    width = 40,
    height = 50,
    opts = {
        position = "center",
        redraw = true,
        window_config = {},
    },
}

alpha_config = alpha_theme.config
alpha_config.layout[2] = alpha_header
alpha_config.layout[3] = { type = "padding", val = 2 }
alpha_config.layout[6] = { type = "padding", val = 2 }

alpha.setup(alpha_config)

However this results in the following display, where the terminal output is overlapping the Recent Files section. Am I misconfiguring the layout? I thought the layout table was rendered in order from top to bottom but it looks like that isn't the case here:

Screenshot 2023-03-21 at 9 30 46 AM

goolord commented 1 year ago

hmm it should be, lua tables are kinda weird so it could be looping through the layout table in a weird way. i'm not sure. i'll look into this when i get some time

goolord commented 1 year ago

should be fixed in https://github.com/goolord/alpha-nvim/commit/dafa11a6218c2296df044e00f88d9187222ba6b0

not sure how this worked as expected for others, or maybe people were adding padding manually

dwijesinghe commented 1 year ago

@goolord I just updated, but it looks like that just moved everything further down for me (see screenshot). Am I doing something wrong here? It looks as if the terminal floating window is getting padded instead of the subsequent content. If it helps I'm using iTerm2.

Screenshot 2023-03-21 at 11 54 10 AM

goolord commented 1 year ago

you have to set the height of your window to the correct height. eyeballing it, it looks like your ascii image is 24 lines tall, so set height = 24

dwijesinghe commented 1 year ago

@goolord 🤦‍♂️ got it. Thank you so much for the fast response and quick fix!