experiment: extremely precise scrolling on paste
[?]
Jun 10, 2022, 8:59 PM
WIDXZBNW4CCOGWHCQSICXRPSZ4MB24OJZLEC3RO3UTEZKEFUZBSQCDependencies
- [2]
SN2QONLIautosave on cut/paste - [3]
3TDOZESEextract scrolling logic out of insert_return - [4]
IRCKL6VNextract scrolling logic out of insert_at_cursor - [5]
JJ7J4PUBsome unnecessary mutations - [6]
5ZFHMYQI. - [7]
NQWWTGXRswitch undo/redo to ctrl- hotkeys - [8]
LS55YKGWswitch copy/paste to ctrl- hotkeys - [9]
BTKAW76Lrename - [*]
OTIBCAUJlove2d scaffold
Change contents
- edit in main.lua at line 431
local draw_fn = App.drawApp.draw = nil -- disable temporarily - edit in main.lua at line 437
draw_fn() - edit in main.lua at line 445
draw_fn() - edit in main.lua at line 452[5.859]→[5.859:1171](∅→∅),[5.1171]→[5.237:282](∅→∅),[5.282]→[5.1281:1766](∅→∅),[5.1281]→[5.1281:1766](∅→∅),[5.1766]→[5.283:328](∅→∅)
end-- hack 1: if we have too many newlines we definitely need to scrollfor i=before_line,Cursor1.line doLines[i].screen_line_starting_pos = nilText.populate_screen_line_starting_pos(i)endif Cursor1.line-Screen_top1.line+1 + num_newlines > App.screen.height/Line_height thenText.snap_cursor_to_bottom_of_screen()end-- hack 2: if we have too much text wrapping we definitely need to scrolllocal 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 thenText.snap_cursor_to_bottom_of_screen() - edit in main.lua at line 453
App.draw = draw_fn