revert previous commit

[?]
Jun 10, 2022, 8:59 PM
SR7L4QPZ5JPBFC26VOYIXJHUROBC7EW52V2QM2JOF4JWTSTEUKOQC

Dependencies

  • [2] WIDXZBNW experiment: extremely precise scrolling on paste
  • [3] SN2QONLI autosave on cut/paste
  • [4] NQWWTGXR switch undo/redo to ctrl- hotkeys
  • [5] LS55YKGW switch copy/paste to ctrl- hotkeys
  • [6] 65XHTZEK regression: couldn't do many drawing operations because line.y was reset
  • [7] BTKAW76L rename
  • [8] 5ZFHMYQI .
  • [9] 3TDOZESE extract scrolling logic out of insert_return
  • [10] Z4XRNDTR find text
  • [11] IRCKL6VN extract scrolling logic out of insert_at_cursor
  • [*] OTIBCAUJ love2d scaffold

Change contents

  • edit in main.lua at line 431
    [3.620][2.8:80]()
    local draw_fn = App.draw
    App.draw = nil -- disable temporarily
  • edit in main.lua at line 435
    [3.753][2.81:99]()
    draw_fn()
  • edit in main.lua at line 442
    [3.41][2.100:118]()
    draw_fn()
  • replacement in main.lua at line 449
    [3.646][2.119:142]()
    App.draw = draw_fn
    [3.646]
    [3.43]
    -- hack 1: if we have too many newlines we definitely need to scroll
    for i=before_line,Cursor1.line do
    Lines[i].screen_line_starting_pos = nil
    Text.populate_screen_line_starting_pos(i)
    end
    if Cursor1.line-Screen_top1.line+1 + num_newlines > App.screen.height/Line_height then
    Text.snap_cursor_to_bottom_of_screen()
    end
    -- hack 2: if we have too much text wrapping we definitely need to scroll
    local clipboard_text = App.newText(love.graphics.getFont(), clipboard_data)
    local clipboard_width = App.width(clipboard_text)
    --? print(Cursor_y, Cursor_y*Line_width, Cursor_y*Line_width+Cursor_x, Cursor_y*Line_width+Cursor_x+clipboard_width, Line_width*App.screen.height/Line_height)
    if Cursor_y*Line_width+Cursor_x + clipboard_width > Line_width*App.screen.height/Line_height then
    Text.snap_cursor_to_bottom_of_screen()
    end