diff options
| author | t <t@tjp.lol> | 2026-08-26 08:01:36 -0600 |
|---|---|---|
| committer | t <t@tjp.lol> | 2026-08-26 08:37:15 -0600 |
| commit | eeb3499f58fa909df7074e689c0f029c59ea767f (patch) | |
| tree | e8812fb196fabe41ec2488d1c6567c7656f2af88 /init.lua | |
| parent | ab829fbcbbac3c50ece8e67953b024710d4b1bc6 (diff) | |
Let the host fit extension header rows
Return inventory entries as styled text chunks and remove the extension's
byte-counting wrapper. The host now owns display-width measurement,
wrapping and padding for these rows.
Diffstat (limited to 'init.lua')
| -rw-r--r-- | init.lua | 20 |
1 files changed, 1 insertions, 19 deletions
@@ -53,22 +53,6 @@ local function subscribe(ext, name, handler) end end -local function wrap_plain(text, width) - width = math.max(1, width or 1) - local lines, from = {}, 1 - while #text - from + 1 > width do - local window = text:sub(from, from + width - 1) - local cut = window:match("^.*() ") or width - lines[#lines + 1] = text:sub(from, from + cut - 1):gsub("%s+$", "") - from = from + cut - while from <= #text and text:sub(from, from) == " " do - from = from + 1 - end - end - lines[#lines + 1] = text:sub(from) - return lines -end - local function install_header(ext, profiles, workflows) local profile_names, workflow_names = {}, {} for _, profile in ipairs(profiles.list) do @@ -91,9 +75,7 @@ local function install_header(ext, profiles, workflows) { "workflows", workflow_names }, }) do local value = #inventory[2] == 0 and "(none)" or table.concat(inventory[2], ", ") - for _, line in ipairs(wrap_plain(" " .. inventory[1] .. ": " .. value, width)) do - extras[#extras + 1] = DIM .. line .. RESET - end + extras[#extras + 1] = DIM .. " " .. inventory[1] .. ": " .. value .. RESET end local at = (#lines > 0 and lines[#lines] == "") and #lines or (#lines + 1) for index = #extras, 1, -1 do |
