X-Git-Url: https://git.stderr.nl/gitweb?p=matthijs%2Fmaster-project%2Freport.git;a=blobdiff_plain;f=pret-trans.lua;h=6ad51b74574768036e04200f2be9b0734f60a1b2;hp=ac1b525946364600d9bff3616f14ec6539921cd8;hb=ffef13cb64e18f66825b861a0ee709637125d9c3;hpb=cb736fa056825e66c2831a01843cfcaf4bf9b4b8 diff --git a/pret-trans.lua b/pret-trans.lua index ac1b525..6ad51b7 100644 --- a/pret-trans.lua +++ b/pret-trans.lua @@ -9,7 +9,7 @@ local utf = unicode.utf8 -vis = buffers.newvisualizer("trans") +local vis = buffers.newvisualizer("trans") local commands = {} -- A command to create a horizontal rule. @@ -91,7 +91,11 @@ function vis.end_of_display() break end end - + + 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 = {}, {}, {}