2 regressions:

- loading a file from the command line
- don't insert empty lines when loading a file from the command line
This commit is contained in:
Kartik K. Agaram 2022-05-16 15:08:49 -07:00
parent ff1d4d988a
commit 34f9670215
1 changed files with 7 additions and 6 deletions

View File

@ -51,11 +51,6 @@ exec_payload = nil
filename = nil
function love.load(arg)
if #arg > 0 then
filename = arg[1]
lines = load_from_disk(filename)
end
table.insert(lines, '')
-- maximize window
love.window.setMode(0, 0) -- maximize
screenw, screenh, screenflags = love.window.getMode()
@ -64,8 +59,14 @@ function love.load(arg)
screenh = screenh-100
love.window.setMode(screenw, screenh)
love.window.setTitle("Text with Lines")
love.keyboard.setTextInput(true) -- bring up keyboard on touch screen
drawingw = math.floor(screenh/2/40)*40
love.keyboard.setTextInput(true) -- bring up keyboard on touch screen
if #arg > 0 then
filename = arg[1]
lines = load_from_disk(filename)
else
table.insert(lines, '')
end
end
function love.draw()