about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--edit.lua3
-rw-r--r--main.lua4
2 files changed, 4 insertions, 3 deletions
diff --git a/edit.lua b/edit.lua
index c2a6a90..dee5334 100644
--- a/edit.lua
+++ b/edit.lua
@@ -13,7 +13,6 @@ Help_background_color = {r=0, g=0.5, b=0, a=0.1}
 utf8 = require 'utf8'
 
 require 'file'
-require 'button'
 require 'text'
 require 'drawing'
 require 'geom'
@@ -112,8 +111,6 @@ Cursor_time = 0
 end  -- App.initialize_globals
 
 function edit.draw()
-  Button_handlers = {}
-
   App.color(Text_color)
 --?   print(Screen_top1.line, Screen_top1.pos, Cursor1.line, Cursor1.pos)
   assert(Text.le1(Screen_top1, Cursor1))
diff --git a/main.lua b/main.lua
index 6a4e30c..c9c5142 100644
--- a/main.lua
+++ b/main.lua
@@ -2,12 +2,15 @@ utf8 = require 'utf8'
 
 require 'app'
 require 'test'
+
 require 'keychord'
+require 'button'
 
 require 'main_tests'
 
 -- delegate most business logic to a layer that can be reused by other projects
 require 'edit'
+Editor_state = {}
 
 -- called both in tests and real run
 function App.initialize_globals()
@@ -136,6 +139,7 @@ function App.filedropped(file)
 end
 
 function App.draw()
+  Button_handlers = {}
   edit.draw()
 end