about summary refs log tree commit diff stats
path: root/source_text.lua
diff options
context:
space:
mode:
Diffstat (limited to 'source_text.lua')
-rw-r--r--source_text.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/source_text.lua b/source_text.lua
index 9125cb0..c281acf 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)
@@ -223,7 +223,7 @@ function Text.insert_at_cursor(State, t)
 end
 
 -- Don't handle any keys here that would trigger text_input above.
-function Text.keychord_press(State, chord)
+function Text.keychord_press(State, chord, key, scancode, is_repeat)
 --?   print('chord', chord, State.selection1.line, State.selection1.pos)
   --== shortcuts that mutate text
   if chord == 'return' then