about summary refs log tree commit diff stats
path: root/source_text.lua
diff options
context:
space:
mode:
Diffstat (limited to 'source_text.lua')
-rw-r--r--source_text.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/source_text.lua b/source_text.lua
index 8b34d52..f93e859 100644
--- a/source_text.lua
+++ b/source_text.lua
@@ -1035,6 +1035,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] = {}