bugfix
[?]
Jun 14, 2022, 12:23 AM
4VKEE43Z7MUPNIAOCK36INVBNHRTSWRRN37TIKRPXPH3DRKGHHAQCDependencies
- [2]
U52E2XZNfix a crash - [3]
MHOUX5JFexperiment: turn off JIT - [4]
J2SVGR2Eexperiment: blinking cursor - [5]
RMKMPFT5fix a corner case when selecting text - [6]
GCEF4N3Vstop repeatedly checking for line wrapping - [7]
R53OF3ONone bug I've repeatedly run into while testing with Moby Dick - [8]
CVGE3SIGI feel confident now that page-down is working. - [9]
5FW7YOFThighlight selection while dragging - [10]
BULPIBEGbeginnings of a module for the text editor - [11]
5L7K4GBDclicking to the right of a wrapped line - [12]
XOAHJ6M3similar tests for cursor up - [13]
HOSPP2ANcrisp font rendering - [14]
U7M4M2F7bugfix: don't rely on Screen_bottom1 while scrolling - [15]
H2DPLWMVsnapshot: wrapping long lines at word boundaries - [16]
3TFEAQSWstart using some globals - [17]
2RXZ3PGObeginning of a new approach to scroll+wrap - [18]
BOFNXP5Gclicking now moves the cursor even on long, wrapped lines - [*]
LXTTOB33extract a couple of files - [*]
GN3IF4WFbugfix: pasting newlines - [*]
OTIBCAUJlove2d scaffold - [*]
73OCE2MCafter much struggle, a brute-force undo - [*]
AJB4LFRBtry to maintain a reasonable line width - [*]
R6GUSTBYdefault font size and line-height - [*]
NEXUNNCFextract a function - [*]
Z4XRNDTRfind text - [*]
QZH3PQFU.
Change contents
- edit in text_tests.lua at line 130
function test_click_on_wrapping_line_containing_non_ascii()io.write('\ntest_click_on_wrapping_line_containing_non_ascii')-- display a wrapping line containing non-ASCIIApp.screen.init{width=80, height=80}-- 12345678901234Lines = load_array{'madam I’m adam'} -- notice the non-ASCII apostropheLine_width = 75Cursor1 = {line=1, pos=1}Screen_top1 = {line=1, pos=1}Screen_bottom1 = {}App.draw()local y = Margin_topApp.screen.check(y, 'madam ', 'F - test_click_on_wrapping_line_containing_non_ascii/baseline/screen:1')y = y + Line_heightApp.screen.check(y, 'I’m ada', 'F - test_click_on_wrapping_line_containing_non_ascii/baseline/screen:2')y = y + Line_heightApp.screen.check(y, 'm', 'F - test_click_on_wrapping_line_containing_non_ascii/baseline/screen:3')y = y + Line_height-- click past the end of itApp.draw()App.run_after_mouse_click(App.screen.width-2,y-2, '1')-- cursor moves to end of linecheck_eq(Cursor1.pos, 15, 'F - test_click_on_wrapping_line_containing_non_ascii/cursor') -- one more than the number of UTF-8 code-pointsend - replacement in text.lua at line 15
--? print('text.draw')--? print('text.draw', line_index) - edit in text.lua at line 383
--? print(Cursor1.line, Cursor1.pos, #Lines[Cursor1.line].data)--? print(Lines[Cursor1.line].data)assert(byte_offset) - edit in text.lua at line 684
--? print('Text.to_pos_on_line', mx, my, 'width', Line_width) - edit in text.lua at line 692
--? print('iter', y, screen_line_index, screen_line_starting_pos, string.sub(line.data, screen_line_starting_pos)) - edit in text.lua at line 699
--? print('past end of non-final line; return') - replacement in text.lua at line 702
local s = string.sub(line.data, screen_line_starting_pos)local screen_line_starting_byte_offset = utf8.offset(line.data, screen_line_starting_pos)assert(screen_line_starting_byte_offset)local s = string.sub(line.data, screen_line_starting_byte_offset)--? print('return', mx, Text.nearest_cursor_pos(s, mx), '=>', screen_line_starting_pos + Text.nearest_cursor_pos(s, mx) - 1) - edit in text.lua at line 884
--? print(x, frag) - edit in text.lua at line 886
--? print(x, pos, frag, frag_width) - edit in text.lua at line 889
--? print(' ', #line.screen_line_starting_pos, line.data) - edit in text.lua at line 890
--? print('new screen line:', #line.screen_line_starting_pos, pos) - edit in main.lua at line 88
Quit = false - edit in main.lua at line 106
--? Line_width = 80 - edit in main.lua at line 128
Quit = true - edit in main.lua at line 266
--? if Quit then os.exit(1) end - edit in main.lua at line 329[28.157][5.2423]
--? print(Cursor1.line, Cursor1.pos)