diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2024-10-14 15:57:37 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2024-10-14 15:57:37 -0700 |
commit | c82750f027fefaf7364d221613422e009b3bbc52 (patch) | |
tree | 40c1f07072536f66cabbe2968d4dbdea2244854b | |
parent | db8d91f50023c6293115ffb4d305ece05857a5ae (diff) | |
parent | 549423b01891b2bebfc869802f71e01327b9553b (diff) | |
download | view.love-c82750f027fefaf7364d221613422e009b3bbc52.tar.gz |
Merge text.love
-rw-r--r-- | source_text.lua | 4 | ||||
-rw-r--r-- | text.lua | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/source_text.lua b/source_text.lua index 9125cb0..284ed00 100644 --- a/source_text.lua +++ b/source_text.lua @@ -90,9 +90,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) diff --git a/text.lua b/text.lua index d5940f3..8f6bf95 100644 --- a/text.lua +++ b/text.lua @@ -63,9 +63,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) |