about summary refs log tree commit diff stats
path: root/edit.lua
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2022-09-05 11:28:03 -0700
committerKartik K. Agaram <vc@akkartik.com>2022-09-05 11:29:39 -0700
commit528c64d690c2d1cb4b3b70c37008b3ba37d904b9 (patch)
tree6a05d6d291276b5a3c63475686e02648f3091da6 /edit.lua
parent9f94470f9dd56c03c66d98bbeff2fc60995cc0ae (diff)
downloadtext.love-528c64d690c2d1cb4b3b70c37008b3ba37d904b9.tar.gz
support drawings in the source editor
Diffstat (limited to 'edit.lua')
-rw-r--r--edit.lua8
1 files changed, 5 insertions, 3 deletions
diff --git a/edit.lua b/edit.lua
index 87cf6c2..29f28d0 100644
--- a/edit.lua
+++ b/edit.lua
@@ -134,7 +134,7 @@ function edit.draw(State)
     local line = State.lines[line_index]
 --?     print('draw:', y, line_index, line)
     if y + State.line_height > App.screen.height then break end
-    State.screen_bottom1.line = line_index
+    State.screen_bottom1 = {line=line_index, pos=nil}
     if line.mode == 'text' then
 --?       print('text.draw', y, line_index)
       local startpos = 1
@@ -169,7 +169,6 @@ function edit.draw(State)
       assert(false)
     end
   end
---?   print('screen bottom: '..tostring(State.screen_bottom1.pos)..' in '..tostring(State.lines[State.screen_bottom1.line].data))
   if State.search_term then
     Text.draw_search_bar(State)
   end
@@ -331,7 +330,10 @@ function edit.keychord_pressed(State, chord, key)
     return
   elseif chord == 'C-f' then
     State.search_term = ''
-    State.search_backup = {cursor={line=State.cursor1.line, pos=State.cursor1.pos}, screen_top={line=State.screen_top1.line, pos=State.screen_top1.pos}}
+    State.search_backup = {
+      cursor={line=State.cursor1.line, pos=State.cursor1.pos},
+      screen_top={line=State.screen_top1.line, pos=State.screen_top1.pos},
+    }
     assert(State.search_text == nil)
   -- zoom
   elseif chord == 'C-=' then