about summary refs log tree commit diff stats
path: root/text.lua
diff options
context:
space:
mode:
Diffstat (limited to 'text.lua')
-rw-r--r--text.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/text.lua b/text.lua
index cd80464..db51ac4 100644
--- a/text.lua
+++ b/text.lua
@@ -973,6 +973,12 @@ end
 
 function Text.redraw_all(State)
 --?   print('clearing fragments')
+  -- Perform some early sanity checking here, in hopes that we correctly call
+  -- this whenever we change editor state.
+  if State.right <= State.left then
+    assert(false, ('Right margin %d must be to the right of the left margin %d'):format(State.right, State.left))
+  end
+
   State.line_cache = {}
   for i=1,#State.lines do
     State.line_cache[i] = {}