diff options
Diffstat (limited to 'text.lua')
-rw-r--r-- | text.lua | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/text.lua b/text.lua index 7fa4d2e..88ee18d 100644 --- a/text.lua +++ b/text.lua @@ -152,6 +152,7 @@ function Text.insert_at_cursor(t) else byte_offset = 1 end +--? print(Screen_top1.line, Screen_top1.pos, Cursor1.line, Cursor1.pos, Screen_bottom1.line, Screen_bottom1.pos) Lines[Cursor1.line].data = string.sub(Lines[Cursor1.line].data, 1, byte_offset-1)..t..string.sub(Lines[Cursor1.line].data, byte_offset) Lines[Cursor1.line].fragments = nil Lines[Cursor1.line].screen_line_starting_pos = nil @@ -160,6 +161,7 @@ function Text.insert_at_cursor(t) if scroll_down then Text.populate_screen_line_starting_pos(Cursor1.line) Text.snap_cursor_to_bottom_of_screen() +--? print('=>', Screen_top1.line, Screen_top1.pos, Cursor1.line, Cursor1.pos, Screen_bottom1.line, Screen_bottom1.pos) end end @@ -624,6 +626,7 @@ end function Text.snap_cursor_to_bottom_of_screen() local top2 = Text.to2(Cursor1) + top2.screen_pos = 1 -- start of screen line --? print('cursor pos '..tostring(Cursor1.pos)..' is on the #'..tostring(top2.screen_line)..' screen line down') local y = App.screen.height - Line_height -- duplicate some logic from love.draw |