about summary refs log tree commit diff stats
path: root/edit.lua
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2023-11-18 12:21:30 -0800
committerKartik K. Agaram <vc@akkartik.com>2023-11-18 12:21:30 -0800
commitde66b015bcfbf4a995b25cc74c5f95d2362760a8 (patch)
tree2fb180163f064f2a2a2713012b26dcb9a1d74273 /edit.lua
parenta8dc0ee2be9ebbc55f40bbc12b591a6b2d4a0cfe (diff)
parent007b965b11b681550ee2e2244a2f53e64e88697d (diff)
downloadview.love-de66b015bcfbf4a995b25cc74c5f95d2362760a8.tar.gz
Merge lines.love
Diffstat (limited to 'edit.lua')
-rw-r--r--edit.lua10
1 files changed, 2 insertions, 8 deletions
diff --git a/edit.lua b/edit.lua
index 56f3f10..bfd2709 100644
--- a/edit.lua
+++ b/edit.lua
@@ -100,14 +100,8 @@ end
 -- return y drawn until
 function edit.draw(State)
   App.color(Text_color)
-  if #State.lines ~= #State.line_cache then
-    print(('line_cache is out of date; %d when it should be %d'):format(#State.line_cache, #State.lines))
-    assert(false)
-  end
-  if not Text.le1(State.screen_top1, State.cursor1) then
-    print(State.screen_top1.line, State.screen_top1.pos, State.cursor1.line, State.cursor1.pos)
-    assert(false)
-  end
+  assert(#State.lines == #State.line_cache, ('line_cache is out of date; %d elements when it should be %d'):format(#State.line_cache, #State.lines))
+  assert(Text.le1(State.screen_top1, State.cursor1), ('screen_top (line=%d,pos=%d) is below cursor (line=%d,pos=%d)'):format(State.screen_top1.line, State.screen_top1.pos, State.cursor1.line, State.cursor1.pos))
   State.cursor_x = nil
   State.cursor_y = nil
   local y = State.top