From eeb3499f58fa909df7074e689c0f029c59ea767f Mon Sep 17 00:00:00 2001 From: t Date: Wed, 26 Aug 2026 08:01:36 -0600 Subject: 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. --- init.lua | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) (limited to 'init.lua') diff --git a/init.lua b/init.lua index e4e5240..6058c9d 100644 --- a/init.lua +++ b/init.lua @@ -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 -- cgit v1.3