Use local variables for storing visualizer dicts.
[matthijs/master-project/report.git] / pret-trans.lua
index ac1b525946364600d9bff3616f14ec6539921cd8..6ad51b74574768036e04200f2be9b0734f60a1b2 100644 (file)
@@ -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 = {}, {}, {}