diff --git a/edit.lua b/edit.lua index da7214b..878979f 100644 --- a/edit.lua +++ b/edit.lua @@ -22,7 +22,7 @@ Same_point_distance = 4 -- pixel distance at which two points are considered th edit = {} -function new_editor(top, left, right, bottom, font, font_height) -- currently always draws to bottom of screen +function new_editor(top, left, right, bottom, font, font_height) local result = { top = math.floor(top), left = math.floor(left), @@ -86,7 +86,7 @@ function new_editor(top, left, right, bottom, font, font_height) -- currently a search_backup = nil, -- stuff to restore when cancelling search } return result -end -- new_editor +end function edit.scroll_to_top(Editor) assert(#Editor.lines > 0) diff --git a/keychord.lua b/keychord.lua index b768dfb..6ba89cb 100644 --- a/keychord.lua +++ b/keychord.lua @@ -1,5 +1,3 @@ --- Keyboard driver - Modifiers = {'lctrl', 'rctrl', 'lalt', 'ralt', 'lshift', 'rshift', 'lgui', 'rgui'} function love.keypressed(key, scancode, isrepeat) diff --git a/main.lua b/main.lua index 49cc2f4..dce3621 100644 --- a/main.lua +++ b/main.lua @@ -1,7 +1,3 @@ --- Entrypoint for the app. You can edit this file from within the app if --- you're careful. - --- files that come with LÖVE; we can't edit those from within the app utf8 = require 'utf8' json = require('json') @@ -57,7 +53,7 @@ function love.load(arg) if #arg > 0 and Editor.filename ~= absolutize(arg[1]) then Editor.filename = arg[1] - edit.scroll_to_top(Editor) -- clear out stale locations for the old filename assuming empty file with a single line of text + edit.scroll_to_top(Editor) -- clear out stale locations for the old filename end if #arg > 1 then print('ignoring commandline args after '..arg[1])