about summary refs log tree commit diff stats
path: root/text.lua
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2022-05-19 22:35:26 -0700
committerKartik K. Agaram <vc@akkartik.com>2022-05-19 22:35:26 -0700
commit2f8d727c0bc220d2f762466ffe9754a6b3d4a6cc (patch)
treeb534c0b8cd1d5c5fd87dc095986c57ab076cdf3f /text.lua
parent7749e459a72f0a58f334567c70f0e2268a4e19f1 (diff)
downloadview.love-2f8d727c0bc220d2f762466ffe9754a6b3d4a6cc.tar.gz
bugfix: show cursor when past end of line
Diffstat (limited to 'text.lua')
-rw-r--r--text.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/text.lua b/text.lua
index dc9a42a..af3553b 100644
--- a/text.lua
+++ b/text.lua
@@ -75,6 +75,11 @@ function Text.draw(line, line_width, line_index, cursor_line, cursor_pos)
     x = x + frag_width
     pos = pos + frag_len
   end
+  if cursor_pos == pos then
+    -- cursor
+    love.graphics.setColor(1,0,0)
+    love.graphics.circle('fill', x,y+math.floor(15*Zoom), 2)
+  end
   return y
 end
 -- manual tests: