From 741018db1f1ceca00b1a0b471c58115334db4502 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Mon, 16 May 2022 21:36:44 -0700 Subject: bugfix: up/down across drawings --- main.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/main.lua b/main.lua index 2656477..6992a61 100644 --- a/main.lua +++ b/main.lua @@ -710,12 +710,14 @@ function keychord_pressed(chord) end function cursor_x(line, cursor_pos) + if type(line) == 'table' then return 0 end local line_before_cursor = line:sub(1, cursor_pos-1) local text_before_cursor = love.graphics.newText(love.graphics.getFont(), line_before_cursor) return text_before_cursor:getWidth() end function nearest_cursor_pos(line, x, hint) + if type(line) == 'table' then return hint end if x == 0 then return 1 end -- cgit 1.4.1-2-gfad0