first successful pagedown test, first bug found by test
[?]
May 23, 2022, 3:13 PM
YTSPVDZHEN5LLNMGIBUBLPWFWSFM3SOHBRGWYSDEVFKRTH24ARRQCDependencies
- [2]
3OKKTUT4up and down arrow now moving by screen line where possible - [3]
IRV65LZPfold variables for screen dimensions into the app framework - [4]
QYIFOHW3first test! - [5]
VHQCNMARseveral more modules - [6]
DAENUOGVeliminate assumptions that line length == size in bytes - [7]
LUNH47XXmake text and drawings the same width - [8]
6LJZN727handle chords - [9]
JY4VK7L2rename - [10]
MGT5FTJ3first stab at supporting wrapping in cursor up - [11]
PGZJ6NATensure Filename is writable when opened outside a terminal - [12]
242L3OQXbugfix: ensure Cursor_line is always on a text line - [13]
TRNWIQN6more precise height calculation when scrolling up as much as possible while keeping cursor on screen - [14]
2RXZ3PGObeginning of a new approach to scroll+wrap - [15]
BOFNXP5Gclicking now moves the cursor even on long, wrapped lines - [16]
UWNHC4AAredo y computations - [17]
3CS5KKCIup/down cursor movement - [18]
H2DPLWMVsnapshot: wrapping long lines at word boundaries - [19]
537TQ2QNsome more logging - [20]
AVTNUQYRbasic test-enabled framework - [21]
4C375P53this is a bit clearer - [22]
OTIBCAUJlove2d scaffold - [23]
CVGE3SIGI feel confident now that page-down is working. - [24]
ESETRNLBbugfix: printing the first part of a line at the bottom made it seem non-wrapping - [25]
CA5T33FGone more implication - [26]
2POFQQLWkeep cursor on screen when pressing 'down' - [27]
JCSLDGAHbeginnings of support for multiple shapes - [28]
AVQ5MC5Dfinish uppercasing all globals - [29]
WLHI7KD3new globals: draw partial screen line up top - [30]
7IKRRESBlonger names for indices in long loops - [31]
XX7G2FFJintermingle freehand line drawings with text - [32]
Y6FTGOHJsimpler - [33]
DLQMM265scroll past first page - [34]
B3IWYWSRdelete another arg that can be deduced - [35]
3TFEAQSWstart using some globals - [36]
3QNOKBFMbeginnings of a test harness - [37]
YJGADSGKdelete unused arg - [38]
QU7NHFOVshow cursor - [39]
XNFTJHC4split keyboard handling between Text and Drawing - [*]
BULPIBEGbeginnings of a module for the text editor - [*]
PFT5Y2ZYmove
Change contents
- replacement in text.lua at line 31
if New_foo then print('text: new screen line', y, Screen_height, screen_line_starting_pos) endif New_foo then print('text: new screen line', y, App.screen.height, screen_line_starting_pos) end - replacement in text.lua at line 42
if y + math.floor(15*Zoom) >= Screen_height thenif y + math.floor(15*Zoom) >= App.screen.height then - edit in text.lua at line 82
print('test_draw_text') - edit in text.lua at line 101[4.681][42.1]
function test_pagedown()print('test_pagedown')App.screen.init{width=120, height=45}Lines = load_array{'abc', 'def', 'ghi'}Line_width = 120Cursor1 = {line=1, pos=1}Screen_top1 = {line=1, pos=1}Screen_bottom1 = {}Zoom = 1local screen_top_margin = 15 -- pixelslocal line_height = math.floor(15*Zoom) -- pixels-- initially the first two lines are displayedApp.draw()local y = screen_top_marginApp.screen.check(y, 'abc', 'F - test_pagedown/baseline/screen:1')y = y + line_heightApp.screen.check(y, 'def', 'F - test_pagedown/baseline/screen:2')-- after pagedown the bottom line becomes the topApp.run_after_keychord('pagedown')y = screen_top_marginApp.screen.check(y, 'def', 'F - test_pagedown/screen:1')y = y + line_heightApp.screen.check(y, 'ghi', 'F - test_pagedown/screen:2')endfunction test_pagedown_skip_drawings()print('test_pagedown_skip_drawings')-- some lines of text with a drawing intermixedApp.screen.init{width=50, height=45}Lines = load_array{'abc','```lines', '```','def','ghi'}check_eq(Lines[2].mode, 'drawing', 'F - test_pagedown_skip_drawings/baseline/lines')Line_width = App.screen.widthCursor1 = {line=1, pos=1}Screen_top1 = {line=1, pos=1}Screen_bottom1 = {}Zoom = 1local screen_top_margin = 15 -- pixelslocal drawing_height = App.screen.width / 2 -- default-- initially the screen displays the first line and part of the drawingApp.draw()local y = screen_top_marginApp.screen.check(y, 'abc', 'F - test_pagedown_skip_drawings/baseline/screen:1')-- after pagedown the screen draws the screen up topApp.run_after_keychord('pagedown')y = screen_top_margin + drawing_heightApp.screen.check(y, 'def', 'F - test_pagedown_skip_drawings/screen:1')y = y + line_heightApp.screen.check(y, 'ghi', 'F - test_pagedown_skip_drawings/screen:2')end - edit in text.lua at line 433
print('scroll up') - replacement in text.lua at line 442
local y = Screen_height - math.floor(15*Zoom)local y = App.screen.height - math.floor(15*Zoom) - replacement in main.lua at line 84
New_foo = trueDebug_main = false - replacement in main.lua at line 123
if New_foo then print('== draw') endif Debug_main then print('== draw') end - replacement in main.lua at line 125
if New_foo then print('draw:', line_index, y) endif Debug_main then print('draw:', line_index, y) end - replacement in main.lua at line 149
if New_foo then print('text') endif Debug_main then print('text') end - replacement in main.lua at line 153
if New_foo then print('aa', y) endif Debug_main then print('aa', y) end - replacement in main.lua at line 157
New_foo = falseDebug_main = false - replacement in main.lua at line 198
New_foo = true--? Debug_main = true - edit in main.lua at line 229
print('setting top to', Screen_bottom1.line) - replacement in file.lua at line 110
local i,line = 0, ''local i,line,drawing = 0, '' - edit in file.lua at line 114
--? print(line) - replacement in file.lua at line 116
table.insert(result, load_drawing_from_array(next_line, a, i))--? print('inserting drawing')i, drawing = load_drawing_from_array(next_line, a, i)--? print('i now', i)table.insert(result, drawing) - edit in file.lua at line 121
--? print('inserting text') - edit in file.lua at line 137
--? print(i) - replacement in file.lua at line 165
return drawingreturn i, drawing - replacement in app.lua at line 96
-- App.run_with_keypress('pagedown')-- App.run_after_keypress('pagedown') - edit in app.lua at line 141
print('drawing "'..msg..'" at y '..tostring(y)) - edit in app.lua at line 175
App.screen.contents = {}App.draw()endfunction App.run_after_keychord(key)App.keychord_pressed(key) - edit in app.lua at line 192
if App.screen.contents[screen_row] == nil thenerror('no text at y '..tostring(y))end