Files
HomerandClaude Fable 5.2 572d12e967 LLeMbas IDE: the four bars are its screen; its keys for LLeMbas are the plugin's one table
The IDE starts with the tree open on the left and LLeMbas's settings, chat and prompt on the
right, the state on top and the keys for where the focus is at the bottom. Its cheat sheet and
README read LLeMbas's keys from the plugin's key table; the statusline and the line of buffers
stand in when a bar is switched off; a session saves the code's windows only. Tests at 160x45,
100x30 and 80x24 on the installed IDE's own screen.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-12-02 20:44:14 +00:00

57 lines
2.2 KiB
Lua

-- The bars. LLeMbas IDE's own are the LLeMbas plugin's layout (lua/llembas/layout.lua): the top
-- bar is the tabline, the bottom bar the statusline. What is here is what stands in when one of
-- them is switched off: mini.statusline for the bottom, mini.tabline (the open buffers) for the top.
local M = {}
local set = { statusline = false, tabline = false }
local function active()
local s = require("mini.statusline")
local mode, mode_hl = s.section_mode({ trunc_width = 100 })
local git = s.section_git({ trunc_width = 60 })
local diff = s.section_diff({ trunc_width = 80 })
local diagnostics = s.section_diagnostics({ trunc_width = 80 })
local lsp = s.section_lsp({ trunc_width = 100 })
local filename = s.section_filename({ trunc_width = 140 })
local fileinfo = s.section_fileinfo({ trunc_width = 120 })
local llembas, live = require("llembas_ide.llembas").status()
if s.is_truncated(70) then llembas = "" end
return s.combine_groups({
{ hl = mode_hl, strings = { mode } },
{ hl = "MiniStatuslineDevinfo", strings = { git, diff, diagnostics, lsp } },
"%<",
{ hl = "MiniStatuslineFilename", strings = { filename } },
"%=",
{ hl = live and "LLeMbasIdeStatus" or "LLeMbasIdeStatusOff", strings = { (llembas:gsub("%%", "%%%%")) } },
{ hl = "MiniStatuslineFileinfo", strings = { fileinfo } },
{ hl = mode_hl, strings = { "%l:%v" } },
})
end
--- Set up the stand-in for each bar of the layout that is off. Called at the start and whenever
--- the layout's bars change (`User LLeMbasBars`).
function M.refresh()
local ok, layout = pcall(require, "llembas.layout")
local o = ok and layout.options() or { on = false }
if not (o.on and o.bottom) and not set.statusline then
set.statusline = true
require("mini.statusline").setup({ use_icons = false, content = { active = active } })
end
if not (o.on and o.top) and not set.tabline then
set.tabline = true
require("mini.tabline").setup({ show_icons = false })
end
end
M.active = active
function M.setup()
M.refresh()
vim.api.nvim_create_autocmd("User", {
group = vim.api.nvim_create_augroup("llembas_ide_bars", { clear = true }),
pattern = "LLeMbasBars",
callback = function() M.refresh() end,
})
end
return M