about summary refs log tree commit diff stats
path: root/text.lua
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2024-10-14 13:54:03 -0700
committerKartik K. Agaram <vc@akkartik.com>2024-10-14 15:29:32 -0700
commite0ccf1de675d8b84553a8692d4616020f420e93e (patch)
treef0e39dde2893d483737f996a1e48a407e798d384 /text.lua
parent60bc27decdda993e13c58dc368be8b7e558e9051 (diff)
downloadlines.love-e0ccf1de675d8b84553a8692d4616020f420e93e.tar.gz
bugfix: Unicode
Diffstat (limited to 'text.lua')
-rw-r--r--text.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/text.lua b/text.lua
index 14eb4b1..4c87ad8 100644
--- a/text.lua
+++ b/text.lua
@@ -65,9 +65,9 @@ function Text.screen_line(line, line_cache, i)
   if i >= #line_cache.screen_line_starting_pos then
     return line.data:sub(offset)
   end
-  local endpos = line_cache.screen_line_starting_pos[i+1]-1
+  local endpos = line_cache.screen_line_starting_pos[i+1]
   local end_offset = Text.offset(line.data, endpos)
-  return line.data:sub(offset, end_offset)
+  return line.data:sub(offset, end_offset-1)
 end
 
 function Text.draw_cursor(State, x, y)