clicking to the right of a wrapped line
[?]
May 20, 2022, 5:26 AM
5L7K4GBDEAFH44LMLNKVFMHLWDNXXBKRPEI347VE5ZLXVFSMD2FACDependencies
- [2]
5Q6NIG66bugfix - [3]
BOFNXP5Gclicking now moves the cursor even on long, wrapped lines - [4]
HYEAFRZ2split mouse_pressed events between Text and Drawing - [5]
BULPIBEGbeginnings of a module for the text editor - [*]
H2DPLWMVsnapshot: wrapping long lines at word boundaries - [*]
BJ5X5O4Alet's prevent the text cursor from ever getting on a drawing - [*]
EX3GRC2Kbugfix typo
Change contents
- edit in text.lua at line 50
line.screen_line_starting_pos = nil - edit in text.lua at line 283
--? print('single screen line') - edit in text.lua at line 288
--? print('move_cursor', mx, my)if my < line.y + math.floor(15*Zoom) then--? print('first screen line')Cursor_pos = Text.nearest_cursor_pos(line.data, mx)returnend - replacement in text.lua at line 290
for _,screen_line_starting_pos in ipairs(line.screen_line_starting_pos) do--? print('screen line:', screen_line_starting_pos)for screen_line_index,screen_line_starting_pos in ipairs(line.screen_line_starting_pos) do - edit in text.lua at line 293
-- On all wrapped screen lines but the final one, clicks past end of-- line position cursor on final character of screen line.-- (The final screen line positions past end of screen line as always.)if mx > Line_width and screen_line_index < #line.screen_line_starting_pos thenCursor_pos = line.screen_line_starting_pos[screen_line_index+1] - 1returnend - edit in manual_tests at line 6[2.237][9.32]
click to right of text -> cursor past end of lineclick to right of wrapped text -> cursor on final character of line