From 10ba628793bac9aa26b3ca5a9484b09d1b46e8b6 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Wed, 21 Oct 2026 10:39:57 +0200 Subject: sbbuilder: list the default manifests, and keep them on the first edit The helper replaces its default [manifests] table with the file's, so adding one manifest to a file without the table dropped neovim's, and the page showed no rows for the default that was in effect. With no table in the file the page now lists the helper's defaults, and the first add, remove or URL edit writes them all before its own change. Toml.js gains sections(), to tell a missing table from an empty one. Co-Authored-By: Claude Opus 5.5 --- desktop/modules/sbbuilder/Toml.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'desktop/modules/sbbuilder/Toml.js') diff --git a/desktop/modules/sbbuilder/Toml.js b/desktop/modules/sbbuilder/Toml.js index 46b9914..dddb6f7 100644 --- a/desktop/modules/sbbuilder/Toml.js +++ b/desktop/modules/sbbuilder/Toml.js @@ -92,6 +92,9 @@ function ranges(lines) { return out; } +// The [section] names present, in file order; "" is not one. +function sections(text) { return ranges(text.split("\n")).slice(1).map(r => r.name); } + // [{key, value}] for the active keys of a section, in file order. function entries(text, section) { const lines = text.split("\n"); -- cgit v1.2.3