refactor: simplify

This commit is contained in:
2026-09-03 20:55:37 +02:00
parent 71434f947b
commit 5eb228750d
8 changed files with 176 additions and 235 deletions
+6 -3
View File
@@ -1,15 +1,18 @@
local M = {}
--- Opens a TUI application in a simple centered floating window.
-- Open a command in a simple centered floating window
function M.open_terminal_app(cmd)
local buf = vim.api.nvim_create_buf(false, true)
local w, h = math.floor(vim.o.columns * 0.95), math.floor(vim.o.lines * 0.95)
local lines = vim.o.lines - vim.o.cmdheight - (vim.o.laststatus > 0 and 1 or 0)
local w = math.floor(vim.o.columns * 0.95)
local h = math.floor(lines * 0.92)
local win = vim.api.nvim_open_win(buf, true, {
relative = "editor",
width = w,
height = h,
row = math.floor((vim.o.lines - h) / 2),
row = math.floor((lines - h) / 2),
col = math.floor((vim.o.columns - w) / 2),
border = "rounded",
})