Closed xbladesub closed 1 year ago
I noticed the same issue and after some debugging I found that the issue was in implementation of my custom top padding element. I used something like:
local top_padding = function(height_estimate)
return function()
local height = vim.api.nvim_win_get_height(0) -- <= this was using current window
local calculated = (height - height_estimate) / 2
return math.ceil(math.max(1, calculated))
end
end
local layout = {
{ type = 'padding', val = top_padding(50) },
-- ...
}
So it was checking the current window height, which for a telescope window was of course incorrect. A simple fix was to check current buffer filetype and use the previous padding value:
local top_padding = function(height_estimate)
local cached
return function()
-- Use cached value if redrawing from another window
local filetype = vim.api.nvim_buf_get_option(0, 'filetype')
if cached and filetype ~= 'alpha' then
return cached
end
local height = vim.api.nvim_win_get_height(0)
local calculated = (height - height_estimate) / 2
cached = math.ceil(math.max(1, calculated))
return cached
end
end
@jedrzejboczar where do you use 'layout' property?
I'm not using the presets but defining layout using this setting, so it's require('alpha').setup { layout = ... }
. If you're using a default theme than it's defining the layout, e.g. dashboard.
@jedrzejboczar still have this issue while using this fn for padding.. but it's definitely padding issue - displays normal with padding 0, but looks weird :)
Solved by adding empty lines to my ASCII logo 😆
I have an issue with neovide, thins happens on start but goes away after I open any other buffer or telescope window. Is there any way to fix that?