click to the left of a line
[?]
Jul 29, 2022, 9:38 PM
5BMR5HRT7GN5L4XB4ISP4JJP3ONZESHEEQBCTQE4EVEDL7MBSDGACDependencies
- [2]
EKKFWP4Dbugfix: couple of margin-relative computations - [3]
TGHAJBESuse line cache for drawings as well - [4]
IMEJA43Lsnapshot - [5]
ODLKHO7Bswitch to line index in a function - [6]
4KC7I3E2make colors easier to edit - [7]
ILOA5BYFseparate data structure for each line's cache data - [8]
T57DTBX6add args to some functions - [9]
MXA3RZYKdeduce left/right from state where possible - [10]
EMRPLZPWdrop an arg from a function - [11]
2L5MEZV3experiment: new edit namespace - [12]
CTJ3IZGSadd args to some functions - [13]
52ZZ5TIEswitch to line index in a function - [14]
QCPXQ2E3add state arg to a few functions - [15]
76AIXR7Hbugfix - [16]
LNUHQOGHstart passing in Editor_state explicitly - [17]
HYEAFRZ2split mouse_pressed events between Text and Drawing - [18]
LAW2O3NWextract variable Margin_left - [19]
VSA3FN7X. - [20]
UHB4GARJleft/right margin -> left/right coordinates - [21]
IWYLK45Kclicking to the right of a line within line width - [22]
DAENUOGVeliminate assumptions that line length == size in bytes - [23]
242L3OQXbugfix: ensure Cursor_line is always on a text line - [24]
MYC7XR5Qbugfix: lines that aren't drawn from the start - [25]
CCYSVZA2bugfix: BSOD in #4. - [26]
LF7BWEG4group all editor globals - [27]
BULPIBEGbeginnings of a module for the text editor - [*]
LXTTOB33extract a couple of files - [*]
H3ECRBXFbugfix: clicking on empty lines - [*]
FS2ITYYHrecord a known issue - [*]
ZRKTXF4Qtweak to Readme - [*]
IDGP4BJZnew known issue with drawings
Change contents
- edit in text_tests.lua at line 272
function test_click_with_mouse_to_left_of_line()io.write('\ntest_click_with_mouse_to_left_of_line')-- display a line with the cursor in the middleApp.screen.init{width=50, height=80}Editor_state = edit.initialize_test_state()Editor_state.lines = load_array{'abc'}Text.redraw_all(Editor_state)Editor_state.cursor1 = {line=1, pos=3}Editor_state.screen_top1 = {line=1, pos=1}Editor_state.screen_bottom1 = {}-- click to the left of the lineedit.draw(Editor_state)edit.run_after_mouse_click(Editor_state, Editor_state.left-4,Editor_state.top+5, 1)-- cursor moves to start of linecheck_eq(Editor_state.cursor1.line, 1, 'F - test_click_with_mouse_to_left_of_line/cursor:line')check_eq(Editor_state.cursor1.pos, 1, 'F - test_click_with_mouse_to_left_of_line/cursor:pos')check_nil(Editor_state.selection1.line, 'F - test_click_with_mouse_to_left_of_line/selection is empty to avoid perturbing future edits')end - edit in text.lua at line 694
if x < State.left then return false end - replacement in text.lua at line 761[4.199]→[4.517:534](∅→∅),[4.718]→[4.517:534](∅→∅),[4.7154]→[4.517:534](∅→∅),[4.517]→[4.517:534](∅→∅)
if x == 0 thenif x < left then - edit in edit.lua at line 134
--? print(State.screen_top1.line, State.screen_top1.pos, State.cursor1.line, State.cursor1.pos) - replacement in edit.lua at line 135
assert(Text.le1(State.screen_top1, State.cursor1))if not Text.le1(State.screen_top1, State.cursor1) thenprint(State.screen_top1.line, State.screen_top1.pos, State.cursor1.line, State.cursor1.pos)assert(false)end - edit in README.md at line 65[32.135][33.203]
* Long wrapping lines can't yet distinguish between the cursor at end of onescreen line and start of the next, so clicking the mouse to position thecursor can very occasionally do the wrong thing.