Files
HomerandClaude Fable 5.2 31ede4d8d2 ide: the LLeMbas IDE distribution — one installer, a pinned Neovim, a branded configuration
A new top-level ide/: install.sh places a hash-checked Neovim release, five third-party
plugins each at one pinned commit, the LLeMbas plugin from nvim/, a generated colourscheme
and a launcher, for one user and under its own NVIM_APPNAME. Built in a staging directory,
started there once, then swapped in.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-12-01 19:49:21 +00:00

31 lines
1.2 KiB
Lua

-- Small shared pieces of the IDE's own screens.
local M = {}
--- A read-only page in a centred floating window; q or <Esc> closes it. Returns the buffer.
function M.page(title, lines)
local buf = vim.api.nvim_create_buf(false, true)
vim.api.nvim_buf_set_lines(buf, 0, -1, false, lines)
vim.bo[buf].modifiable = false
vim.bo[buf].bufhidden = "wipe"
vim.bo[buf].filetype = "llembas-ide-page"
local width = 20
for _, l in ipairs(lines) do width = math.max(width, vim.fn.strdisplaywidth(l)) end
width = math.min(width + 2, math.max(20, vim.o.columns - 4))
local height = math.min(#lines, math.max(3, vim.o.lines - 6))
local win = vim.api.nvim_open_win(buf, true, {
relative = "editor", style = "minimal", border = "rounded",
title = " " .. title .. " ", title_pos = "center",
width = width, height = height,
row = math.max(0, math.floor((vim.o.lines - height) / 2) - 1),
col = math.max(0, math.floor((vim.o.columns - width) / 2)),
})
vim.wo[win].wrap = false
vim.wo[win].cursorline = false
for _, key in ipairs({ "q", "<Esc>" }) do
vim.keymap.set("n", key, function() pcall(vim.api.nvim_win_close, win, true) end, { buffer = buf, nowait = true })
end
return buf, win
end
return M