move some code
[?]
May 29, 2022, 5:42 AM
AMSESRTH4T7EIEMXEFPMZFC55QAOVSWAN2XOQUUEB5ECHRDZUAYQCDependencies
- [2]
4RUI5X52a few tests for pageup, and a bugfix - [3]
LERERVPHkeep one screen line of overlap on pagedown - [4]
ZPUQSPQPextract a few methods - [5]
IRV65LZPfold variables for screen dimensions into the app framework - [6]
VCMS2CWTbugfix: escape key to hide online help - [7]
U7M4M2F7bugfix: don't rely on Screen_bottom1 while scrolling - [8]
2RXZ3PGObeginning of a new approach to scroll+wrap - [9]
BYG5CEMVsupport for naming points - [10]
MDXGMZU2disable all debug prints - [11]
252M2QMDforgot to move this special case out - [12]
KJKKASHZreduce ambitions a bit: page up/down need not start screen from the middle of a line - [13]
242L3OQXbugfix: ensure Cursor_line is always on a text line - [14]
YTSPVDZHfirst successful pagedown test, first bug found by test - [15]
DLQMM265scroll past first page - [16]
DXT4QTAHa few more integer coordinates - [17]
XNFTJHC4split keyboard handling between Text and Drawing - [18]
CVGE3SIGI feel confident now that page-down is working. - [*]
BULPIBEGbeginnings of a module for the text editor - [*]
OTIBCAUJlove2d scaffold
Change contents
- edit in text.lua at line 995
elseif chord == 'pageup' then-- 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)elseif chord == 'pagedown' thenScreen_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) - edit in main.lua at line 233[5.941]→[5.1593:1627](∅→∅),[5.1593]→[5.1593:1627](∅→∅),[5.2544]→[5.9490:9533](∅→∅),[5.1627]→[5.9490:9533](∅→∅),[5.9533]→[5.521:562](∅→∅),[5.562]→[3.2403:2470](∅→∅),[5.562]→[5.9557:9627](∅→∅),[5.1083]→[5.9557:9627](∅→∅),[5.1635]→[5.9557:9627](∅→∅),[3.2470]→[5.9557:9627](∅→∅),[5.9557]→[5.9557:9627](∅→∅),[5.845]→[5.939:1020](∅→∅),[5.9627]→[5.939:1020](∅→∅),[5.1721]→[5.939:1020](∅→∅),[5.1020]→[5.1636:1679](∅→∅),[5.1020]→[5.1721:1796](∅→∅),[5.1123]→[5.1721:1796](∅→∅),[5.1679]→[5.1721:1796](∅→∅),[5.1721]→[5.1721:1796](∅→∅),[5.1796]→[2.4240:4700](∅→∅),[2.4700]→[5.2033:2043](∅→∅),[5.9789]→[5.2033:2043](∅→∅),[5.2033]→[5.2033:2043](∅→∅),[5.2043]→[2.4701:4746](∅→∅),[2.4746]→[5.2087:2095](∅→∅),[5.9836]→[5.2087:2095](∅→∅),[5.2087]→[5.2087:2095](∅→∅),[5.2095]→[2.4747:4780](∅→∅),[2.4780]→[5.9905:9941](∅→∅),[5.163]→[5.9905:9941](∅→∅),[5.9941]→[2.4781:4815](∅→∅),[2.4815]→[5.1099:1180](∅→∅),[5.9941]→[5.1099:1180](∅→∅),[5.2194]→[5.1099:1180](∅→∅),[5.1180]→[2.4816:4892](∅→∅)
elseif chord == 'pagedown' thenScreen_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)elseif chord == 'pageup' then-- 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)