about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2022-08-19 17:11:47 -0700
committerKartik K. Agaram <vc@akkartik.com>2022-08-19 17:11:47 -0700
commit08b7318c0d35fbcd0a951e4cc6b3ce504234100e (patch)
treec10096d0bfdced8381e32ace297d6d9dd2cea72d
parent8d4346f3a8b4eac81d20da02900141cd1a6eadec (diff)
parent13f67fa851acdba4563d0dca24701c5f97a6a55f (diff)
downloadtext.love-08b7318c0d35fbcd0a951e4cc6b3ce504234100e.tar.gz
Merge lines.love
-rw-r--r--main.lua1
-rw-r--r--main_tests.lua2
2 files changed, 3 insertions, 0 deletions
diff --git a/main.lua b/main.lua
index 709e535..19901b4 100644
--- a/main.lua
+++ b/main.lua
@@ -124,6 +124,7 @@ function App.filedropped(file)
   file:open('r')
   Editor_state.lines = load_from_file(file)
   file:close()
+  Text.redraw_all(Editor_state)
   love.window.setTitle('text.love - '..Editor_state.filename)
 end
 
diff --git a/main_tests.lua b/main_tests.lua
index b89c634..31605f0 100644
--- a/main_tests.lua
+++ b/main_tests.lua
@@ -19,6 +19,7 @@ end
 function test_drop_file()
   io.write('\ntest_drop_file')
   App.screen.init{width=Editor_state.left+300, height=300}
+  Editor_state = edit.initialize_test_state()
   App.filesystem['foo'] = 'abc\ndef\nghi\n'
   local fake_dropped_file = {
     opened = false,
@@ -41,6 +42,7 @@ function test_drop_file()
   check_eq(Editor_state.lines[1].data, 'abc', 'F - test_drop_file/lines:1')
   check_eq(Editor_state.lines[2].data, 'def', 'F - test_drop_file/lines:2')
   check_eq(Editor_state.lines[3].data, 'ghi', 'F - test_drop_file/lines:3')
+  edit.draw(Editor_state)
 end
 
 function test_drop_file_saves_previous()