bugfix: clicking past end of screen line
[?]
Jun 29, 2022, 4:11 PM
GJLOKCYKETWXJXBOS5222HVZIKBDOGLLR5QLUZYCTZG7FBYDTQMQCDependencies
- [2]
4VKEE43Zbugfix - [3]
2RXZ3PGObeginning of a new approach to scroll+wrap - [4]
GE56XURAbugfix: cursor past end of screen line - [5]
5L7K4GBDclicking to the right of a wrapped line - [6]
5FW7YOFThighlight selection while dragging - [7]
BOFNXP5Gclicking now moves the cursor even on long, wrapped lines - [*]
LXTTOB33extract a couple of files - [*]
BULPIBEGbeginnings of a module for the text editor
Change contents
- edit in text_tests.lua at line 164
function test_click_on_wrapping_line()io.write('\ntest_click_on_wrapping_line')-- display a wrapping lineApp.screen.init{width=80, height=80}-- 12345678901234Lines = load_array{"madam I'm adam"}Line_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/baseline/screen:1')y = y + Line_heightApp.screen.check(y, "I'm ada", 'F - test_click_on_wrapping_line/baseline/screen:2')y = y + Line_height-- click past end of second screen lineApp.draw()App.run_after_mouse_click(App.screen.width-2,y-2, 1)-- cursor moves to end of screen linecheck_eq(Cursor1.line, 1, 'F - test_click_on_wrapping_line/cursor:line')check_eq(Cursor1.pos, 13, 'F - test_click_on_wrapping_line/cursor:pos')endfunction test_click_past_end_of_wrapping_line()io.write('\ntest_click_past_end_of_wrapping_line')-- display a wrapping lineApp.screen.init{width=80, height=80}-- 12345678901234Lines = load_array{"madam I'm adam"}Line_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_past_end_of_wrapping_line/baseline/screen:1')y = y + Line_heightApp.screen.check(y, "I'm ada", 'F - test_click_past_end_of_wrapping_line/baseline/screen:2')y = y + Line_heightApp.screen.check(y, 'm', 'F - test_click_past_end_of_wrapping_line/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_past_end_of_wrapping_line/cursor') -- one more than the number of UTF-8 code-pointsend - replacement in text.lua at line 688
return line.screen_line_starting_pos[screen_line_index+1]return line.screen_line_starting_pos[screen_line_index+1]-1