bugfix
[?]
May 24, 2022, 9:34 PM
DFSDPDO7RHOLPVT4TD2Z3YZCKS6737LYIWBTJJI4BO73IIAJ5BYQCDependencies
- [2]
4RUI5X52a few tests for pageup, and a bugfix - [3]
76AIXR7Hbugfix - [4]
QYIFOHW3first test! - [5]
S5VCAFKYcouple of tests for cursor down - [6]
IMEJA43Lsnapshot - [7]
HYEAFRZ2split mouse_pressed events between Text and Drawing - [8]
H2DPLWMVsnapshot: wrapping long lines at word boundaries - [9]
DAENUOGVeliminate assumptions that line length == size in bytes - [10]
BULPIBEGbeginnings of a module for the text editor - [11]
5Q6NIG66bugfix - [*]
R53OF3ONone bug I've repeatedly run into while testing with Moby Dick
Change contents
- replacement in text.lua at line 209
check_eq(Screen_top1.line, 1, 'F - test_up_arrow_moves_cursor/screen_top')check_eq(Screen_top1.line, 1, 'F - test_down_arrow_moves_cursor/screen_top') - edit in text.lua at line 442[13.1842][2.1]
function test_up_arrow_scrolls_up_to_empty_line()io.write('\ntest_up_arrow_scrolls_up_from_empty_line')-- display a screenful of text with an empty line just above it outside the screenApp.screen.init{width=120, height=60}Lines = load_array{'', 'abc', 'def', 'ghi', 'jkl'}Line_width = 120Cursor1 = {line=2, pos=1}Screen_top1 = {line=2, pos=1}Screen_bottom1 = {}Zoom = 1local screen_top_margin = 15 -- pixelslocal line_height = math.floor(15*Zoom) -- pixelsApp.draw()local y = screen_top_marginApp.screen.check(y, 'abc', 'F - test_up_arrow_scrolls_up_from_empty_line/baseline/screen:1')y = y + line_heightApp.screen.check(y, 'def', 'F - test_up_arrow_scrolls_up_from_empty_line/baseline/screen:2')y = y + line_heightApp.screen.check(y, 'ghi', 'F - test_up_arrow_scrolls_up_from_empty_line/baseline/screen:3')-- after hitting the up arrow the screen scrolls up by one lineApp.run_after_keychord('up')check_eq(Screen_top1.line, 1, 'F - test_up_arrow_scrolls_up_from_empty_line/screen_top')check_eq(Cursor1.line, 1, 'F - test_up_arrow_scrolls_up_from_empty_line/cursor')y = screen_top_margin-- empty first liney = y + line_heightApp.screen.check(y, 'abc', 'F - test_up_arrow_scrolls_up_from_empty_line/screen:2')y = y + line_heightApp.screen.check(y, 'def', 'F - test_up_arrow_scrolls_up_from_empty_line/screen:3')end - replacement in text.lua at line 955
--? print('--')--? print('-- nearest', x) - edit in text.lua at line 957
--? print('nearest', x, '^'..line..'$', left, right)if left == right thenreturn leftend - replacement in text.lua at line 964
--? print(x, left, right, curr, currxmin, currxmax)--? print('nearest', x, left, right, curr, currxmin, currxmax) - replacement in text.lua at line 1012
local line_before_cursor = line_data:sub(1, cursor_pos-1)--? print(cursor_pos, #line_data, line_data)local cursor_offset = utf8.offset(line_data, cursor_pos)--? print(cursor_offset)assert(cursor_offset)local line_before_cursor = line_data:sub(1, cursor_offset-1) - replacement in text.lua at line 1022
local s_before_cursor = s:sub(1, cursor_pos-1)local cursor_offset = utf8.offset(s, cursor_pos)assert(cursor_offset)local s_before_cursor = s:sub(1, cursor_offset-1)