X-Git-Url: https://git.stderr.nl/gitweb?p=matthijs%2Fmaster-project%2Freport.git;a=blobdiff_plain;f=pret-trans.lua;h=238a4e5c1d9e798dd9dddbfa3d6dea552b9aa361;hp=7f32afded167f7f07fe3f1680c7b5b313a3d78c9;hb=1864c65fe74e332c5aca3ccb9878b98aa1aa93e7;hpb=3ff8ced65f6af69db754b35b263c7d6d9f19e61f diff --git a/pret-trans.lua b/pret-trans.lua index 7f32afd..238a4e5 100644 --- a/pret-trans.lua +++ b/pret-trans.lua @@ -38,7 +38,6 @@ end -- Insert n blank lines local function blanks(n) - print("Inserting " .. n .. " blanks") for i = 1,n do buffers.visualizers.handlers.default.empty_line() end @@ -92,8 +91,11 @@ function vis.end_of_display() break end end - print("Rule length: " .. len) - + + if not len then + error("No horizontal separator found in:\n" .. table.concat(lines, "\n")) + end + -- Split the input in three parts. Stuff before the line, stuff -- after the line, stuff to the right of the line. before, after, rights = {}, {}, {} @@ -106,7 +108,6 @@ function vis.end_of_display() if utf.match(left, "^%-%-%-*") then found_line = true else - print("Looking at " .. line .. "('" .. left .. "', '" .. right .. "')") if utf.len(left) > 0 then if not found_line then table.insert(before, left)