extract a couple more methods
[?]
May 29, 2022, 5:45 AM
KOYAJWE4NJ2J4X3SHEAVMRXYZPZGOMTI7OX3PTUQIDIZ2GQI6UKACDependencies
- [2]
AMSESRTHmove some code - [3]
ZPUQSPQPextract a few methods - [*]
BULPIBEGbeginnings of a module for the text editor
Change contents
- replacement in text.lua at line 996
-- duplicate some logic from love.drawlocal top2 = Text.to2(Screen_top1)--? print(App.screen.height)local y = App.screen.height - math.floor(15*Zoom)while y >= 15 do--? print(y, top2.line)if Screen_top1.line == 1 and Screen_top1.pos == 1 then break endif Lines[Screen_top1.line].mode == 'text' theny = y - math.floor(15*Zoom)elseif Lines[Screen_top1.line].mode == 'drawing' theny = y - 20 - Drawing.pixels(Lines[Screen_top1.line].h)endtop2 = Text.previous_screen_line(top2)endScreen_top1 = Text.to1(top2)Cursor1.line = Screen_top1.lineCursor1.pos = Screen_top1.posText.move_cursor_down_to_next_text_line_while_scrolling_again_if_necessary()--? print(Cursor1.line, Cursor1.pos, Screen_top1.line, Screen_top1.pos)Text.pageup() - replacement in text.lua at line 998
Screen_top1.line = Screen_bottom1.lineScreen_top1.pos = Screen_bottom1.pos--? print('setting top to', Screen_top1.line, Screen_top1.pos)Cursor1.line = Screen_top1.lineCursor1.pos = Screen_top1.posText.move_cursor_down_to_next_text_line_while_scrolling_again_if_necessary()--? print('top now', Screen_top1.line)Text.pagedown()endendfunction Text.pageup()-- duplicate some logic from love.drawlocal top2 = Text.to2(Screen_top1)--? print(App.screen.height)local y = App.screen.height - math.floor(15*Zoom)while y >= 15 do--? print(y, top2.line)if Screen_top1.line == 1 and Screen_top1.pos == 1 then break endif Lines[Screen_top1.line].mode == 'text' theny = y - math.floor(15*Zoom)elseif Lines[Screen_top1.line].mode == 'drawing' theny = y - 20 - Drawing.pixels(Lines[Screen_top1.line].h)endtop2 = Text.previous_screen_line(top2) - edit in text.lua at line 1017
Screen_top1 = Text.to1(top2)Cursor1.line = Screen_top1.lineCursor1.pos = Screen_top1.posText.move_cursor_down_to_next_text_line_while_scrolling_again_if_necessary()--? print(Cursor1.line, Cursor1.pos, Screen_top1.line, Screen_top1.pos) - edit in text.lua at line 1024
function Text.pagedown()Screen_top1.line = Screen_bottom1.lineScreen_top1.pos = Screen_bottom1.pos--? print('setting top to', Screen_top1.line, Screen_top1.pos)Cursor1.line = Screen_top1.lineCursor1.pos = Screen_top1.posText.move_cursor_down_to_next_text_line_while_scrolling_again_if_necessary()--? print('top now', Screen_top1.line)end