idea: set recent_mouse on mouse events

[?]
Jun 1, 2023, 7:57 PM
MRA2Y3EEDV73ZFMWL3EBUXAWZYQSDK4E5FWISWHHJZ2YXTYYYTBAC

Dependencies

  • [2] 7FPELAZB ah, I see the problem
  • [3] UHB4GARJ left/right margin -> left/right coordinates
  • [4] FKNXK2OA switch to line index in a function
  • [5] QCPXQ2E3 add state arg to a few functions
  • [6] LNUHQOGH start passing in Editor_state explicitly
  • [7] PK5U572C drop some extra args
  • [8] S2MISTTM add state arg to a few functions
  • [9] LF7BWEG4 group all editor globals
  • [10] LXTTOB33 extract a couple of files
  • [11] 4CXVIEBS add args to some functions
  • [12] MXA3RZYK deduce left/right from state where possible
  • [13] QJISOCHJ some temporary logging to catch a bug
  • [14] 2L5MEZV3 experiment: new edit namespace

Change contents

  • replacement in select.lua at line 72
    [3.388][3.45902:45938](),[3.1061][3.45902:45938](),[3.4078][3.45902:45938](),[3.45902][3.45902:45938](),[3.45938][3.1062:1135]()
    local time = love.timer.getTime()
    if State.recent_mouse.time and State.recent_mouse.time > time-0.1 then
    [3.4078]
    [2.13]
    if State.recent_mouse.time and State.recent_mouse.time > Current_time-0.1 then
  • replacement in select.lua at line 76
    [3.46052][3.1195:1228]()
    State.recent_mouse.time = time
    [3.46052]
    [3.4079]
    State.recent_mouse.time = Current_time
  • replacement in edit.lua at line 252
    [3.7962][2.330:447]()
    print_and_log(('edit.mouse_press: selection now %d,%d'):format(State.selection1.line, State.selection1.pos))
    [3.7962]
    [3.8026]
    State.recent_mouse = {time=Current_time, line=State.selection1.line, pos=State.selection1.pos}
  • edit in edit.lua at line 289
    [2.744]
    [3.5833]
    State.recent_mouse = {time=Current_time, line=State.cursor1.line, pos=State.cursor1.pos}