stop scanning from start of file on every App.draw
[?]
Jul 8, 2022, 4:51 AM
LFMI3D7D236VAARLPOF3OKWMFVL7KSCVEUBNGJKVOE75ST3AKZSQCDependencies
- [2]
YGCT2D2Ostart loading settings as applicable - [3]
H3ECRBXFbugfix: clicking on empty lines - [4]
U7M4M2F7bugfix: don't rely on Screen_bottom1 while scrolling - [5]
SQLVYKVJrename - [6]
DHCLUDCW. - [7]
EDY3RQULgracefully handle a non-existent filename at the commandline - [8]
2RXZ3PGObeginning of a new approach to scroll+wrap - [9]
U2TKUOIDbugfix: undo drawing creation - [10]
NQKFQSZEundo creating new drawings - [11]
PX7DDEMOautosave slightly less aggressively - [12]
DAENUOGVeliminate assumptions that line length == size in bytes - [13]
MGOQ5XAVstart uppercasing globals - [14]
QU7NHFOVshow cursor - [15]
3TFEAQSWstart using some globals - [16]
IRV65LZPfold variables for screen dimensions into the app framework - [17]
CVGE3SIGI feel confident now that page-down is working. - [18]
S5VCAFKYcouple of tests for cursor down - [19]
OYXDYPGSget rid of debug variables - [20]
LUNH47XXmake text and drawings the same width - [21]
Y6FTGOHJsimpler - [22]
ZZ2B5RPQextract variables for drawing padding - [23]
XVR2O5PIchange text cursor shape - [24]
M6TH7VSZrip out notion of Line_width - [25]
QKAMUWSBanother bugfix in scrolling while inserting text - [26]
4J2WLDRMindent - [27]
OTIBCAUJlove2d scaffold - [28]
DLQMM265scroll past first page - [29]
VJ3ODCHRassert for a bug I saw a while ago but can no longer reproduce - [30]
4NDYV4WDfix 2 bugs in line selection - [31]
ESETRNLBbugfix: printing the first part of a line at the bottom made it seem non-wrapping - [32]
2POFQQLWkeep cursor on screen when pressing 'down' - [33]
Z4XRNDTRfind text - [34]
XX7G2FFJintermingle freehand line drawings with text - [35]
B3IWYWSRdelete another arg that can be deduced - [36]
H2DPLWMVsnapshot: wrapping long lines at word boundaries - [37]
HOSPP2ANcrisp font rendering - [38]
7IKRRESBlonger names for indices in long loops - [39]
6J3NXBYGaffordance to adjust width for word wrap - [40]
LAW2O3NWextract variable Margin_left - [41]
4C375P53this is a bit clearer - [42]
YPHKZVWMextract a new variable - [43]
MYC7XR5Qbugfix: lines that aren't drawn from the start - [44]
UWNHC4AAredo y computations - [45]
5DOC2CBMextract a function - [46]
YTSPVDZHfirst successful pagedown test, first bug found by test - [47]
RTDYYP4Hbugfix: text past cursor was rendered red on wrapped lines - [48]
AVQ5MC5Dfinish uppercasing all globals - [49]
YJGADSGKdelete unused arg
Change contents
- replacement in main.lua at line 235[4.18]→[4.2:44](∅→∅),[4.81]→[4.2:44](∅→∅),[4.2017]→[4.2:44](∅→∅),[4.2296]→[4.2:44](∅→∅),[4.58]→[4.2:44](∅→∅)
for line_index,line in ipairs(Lines) dofor line_index = Screen_top1.line,#Lines dolocal line = Lines[line_index] - replacement in main.lua at line 239[4.4220]→[4.2951:2970](∅→∅),[4.404]→[4.2951:2970](∅→∅),[4.404]→[4.9247:9329](∅→∅),[4.1036]→[4.9247:9329](∅→∅),[4.2970]→[4.9247:9329](∅→∅),[4.223]→[4.9247:9329](∅→∅),[4.9329]→[4.705:759](∅→∅),[4.705]→[4.705:759](∅→∅),[4.759]→[3.558:608](∅→∅),[3.608]→[4.275:305](∅→∅),[4.38]→[4.275:305](∅→∅),[4.38]→[4.759:890](∅→∅),[4.305]→[4.759:890](∅→∅),[4.759]→[4.759:890](∅→∅),[4.890]→[4.155:230](∅→∅),[4.67]→[4.890:1011](∅→∅),[4.230]→[4.890:1011](∅→∅),[4.638]→[4.890:1011](∅→∅),[4.890]→[4.890:1011](∅→∅),[4.1011]→[4.9330:9443](∅→∅),[4.9443]→[4.1121:1148](∅→∅),[4.1121]→[4.1121:1148](∅→∅),[4.1148]→[4.242:281](∅→∅),[4.281]→[4.284:394](∅→∅),[4.284]→[4.284:394](∅→∅)
--? print('a')if line_index >= Screen_top1.line thenScreen_bottom1.line = line_indexif line.mode == 'text' and line.data == '' thenline.starty = yline.startpos = 1-- insert new drawingbutton('draw', {x=4,y=y+4, w=12,h=12, color={1,1,0},icon = icon.insert_drawing,onpress1 = function()Drawing.before = snapshot(line_index-1, line_index)table.insert(Lines, line_index, {mode='drawing', y=y, h=256/2, points={}, shapes={}, pending={}})if Cursor1.line >= line_index thenCursor1.line = Cursor1.line+1endschedule_save()record_undo_event({before=Drawing.before, after=snapshot(line_index-1, line_index+1)})Screen_bottom1.line = line_indexif line.mode == 'text' and line.data == '' thenline.starty = yline.startpos = 1-- insert new drawingbutton('draw', {x=4,y=y+4, w=12,h=12, color={1,1,0},icon = icon.insert_drawing,onpress1 = function()Drawing.before = snapshot(line_index-1, line_index)table.insert(Lines, line_index, {mode='drawing', y=y, h=256/2, points={}, shapes={}, pending={}})if Cursor1.line >= line_index thenCursor1.line = Cursor1.line+1 - replacement in main.lua at line 252[4.331]→[4.331:342](∅→∅),[4.342]→[4.7:132](∅→∅),[4.1175]→[4.7:132](∅→∅),[4.119]→[4.1377:1391](∅→∅),[4.132]→[4.1377:1391](∅→∅),[4.280]→[4.1377:1391](∅→∅),[4.299]→[4.1377:1391](∅→∅),[4.2819]→[4.1377:1391](∅→∅),[4.1377]→[4.1377:1391](∅→∅),[4.1391]→[4.133:145](∅→∅),[4.145]→[4.1209:1254](∅→∅),[4.1391]→[4.1209:1254](∅→∅),[4.1254]→[4.4221:4249](∅→∅),[4.1391]→[4.4221:4249](∅→∅),[4.55]→[4.1391:1432](∅→∅),[4.89]→[4.1391:1432](∅→∅),[4.4249]→[4.1391:1432](∅→∅),[4.1391]→[4.1391:1432](∅→∅),[4.1432]→[4.454:488](∅→∅),[4.488]→[4.118:137](∅→∅),[4.118]→[4.118:137](∅→∅),[4.137]→[4.3:30](∅→∅),[4.1469]→[4.3:30](∅→∅),[4.30]→[4.489:553](∅→∅),[4.30]→[4.1499:1510](∅→∅),[4.193]→[4.1499:1510](∅→∅),[4.553]→[4.1499:1510](∅→∅),[4.1499]→[4.1499:1510](∅→∅),[4.153]→[4.2050:2189](∅→∅)
})if Search_term == nil thenif line_index == Cursor1.line thenText.draw_cursor(Margin_left, y)endendScreen_bottom1.pos = Screen_top1.posy = y + Line_heightelseif line.mode == 'drawing' theny = y+Drawing_padding_topline.y = yDrawing.draw(line)y = y + Drawing.pixels(line.h) + Drawing_padding_bottomelseline.starty = yline.startpos = 1if line_index == Screen_top1.line thenline.startpos = Screen_top1.posschedule_save()record_undo_event({before=Drawing.before, after=snapshot(line_index-1, line_index+1)})end})if Search_term == nil thenif line_index == Cursor1.line thenText.draw_cursor(Margin_left, y) - replacement in main.lua at line 260[4.2201]→[2.1219:1265](∅→∅),[2.1265]→[4.1931:1991](∅→∅),[4.2201]→[4.1931:1991](∅→∅),[4.1991]→[4.4250:4278](∅→∅),[4.407]→[4.4250:4278](∅→∅),[4.4278]→[4.154:183](∅→∅),[4.108]→[4.154:183](∅→∅)
--? print('text.draw', y, line_index)y, Screen_bottom1.pos = Text.draw(line, line_index)y = y + Line_height--? print('=> y', y)endScreen_bottom1.pos = Screen_top1.posy = y + Line_heightelseif line.mode == 'drawing' theny = y+Drawing_padding_topline.y = yDrawing.draw(line)y = y + Drawing.pixels(line.h) + Drawing_padding_bottomelseline.starty = yline.startpos = 1if line_index == Screen_top1.line thenline.startpos = Screen_top1.pos - edit in main.lua at line 274
--? print('text.draw', y, line_index)y, Screen_bottom1.pos = Text.draw(line, line_index)y = y + Line_height--? print('=> y', y)