Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions lua/alpha/term.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,18 @@ local alpha = require("alpha")
local M = {}

function M.open_window(el)
local width = el.width
local height = el.height
local window_config = el.opts and el.opts.window_config or {}
if type(window_config) == 'function' then
window_config = window_config()
end

local width = window_config.width or el.width
local height = window_config.height or el.height

local row = math.floor(height / 5)
local col = math.floor((vim.o.columns - width) / 2)

local opts = vim.tbl_extend("keep", (el.opts and el.opts.window_config) or {}, {
local opts = vim.tbl_extend("keep", window_config, {
relative = "editor",
row = row,
col = col,
Expand Down