about summary refs log tree commit diff stats
path: root/main.lua
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2022-05-18 18:18:34 -0700
committerKartik K. Agaram <vc@akkartik.com>2022-05-18 18:18:34 -0700
commitb586c7332e9e270af5b0ea1b801d63f7a6e6c630 (patch)
treeb872b9369b96b78c5b7e56fa414e67bc38fa7ba2 /main.lua
parentf91e5201241451fe5f9712a97c288f1534e74b11 (diff)
downloadtext.love-b586c7332e9e270af5b0ea1b801d63f7a6e6c630.tar.gz
bugfix: position cursor up top when loading file
Diffstat (limited to 'main.lua')
-rw-r--r--main.lua2
1 files changed, 2 insertions, 0 deletions
diff --git a/main.lua b/main.lua
index 8ca3709..a8cfc57 100644
--- a/main.lua
+++ b/main.lua
@@ -78,6 +78,7 @@ function love.load(arg)
   for i,line in ipairs(Lines) do
     if line.mode == 'text' then
       Cursor_line = i
+      break
     end
   end
   love.window.setTitle('Text with Lines - '..Filename)
@@ -91,6 +92,7 @@ function love.filedropped(file)
   for i,line in ipairs(Lines) do
     if line.mode == 'text' then
       Cursor_line = i
+      break
     end
   end
   love.window.setTitle('Text with Lines - '..Filename)
5 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182