From 5a4b8451ce01efca0f37d55c9668296136fbc3c5 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Mon, 16 May 2022 21:35:19 -0700 Subject: [PATCH] show cursor even on empty lines --- main.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main.lua b/main.lua index 742c048..2656477 100644 --- a/main.lua +++ b/main.lua @@ -102,6 +102,10 @@ function love.draw() onpress1 = function() table.insert(lines, i, {y=y, h=256/2, points={}, shapes={}, pending={}}) end}) + if i == cursor_line then + love.graphics.setColor(0,0,0) + love.graphics.print('_', 25, y+6) -- drop the cursor down a bit to account for the increased font size + end elseif type(line) == 'table' then -- line drawing line.y = y @@ -156,7 +160,6 @@ function love.draw() love.graphics.draw(text, 25,y, 0, 1.5) if i == cursor_line then -- cursor - love.graphics.setColor(0,0,0) love.graphics.print('_', 25+cursor_x(lines[cursor_line], cursor_pos)*1.5, y+6) -- drop the cursor down a bit to account for the increased font size end end