Merge lines.love

[?]
Jun 4, 2023, 10:11 PM
ONHKBLLCD5NDO3HSSUMAMGJ7HDT53JYVV56DI42AEYI3W63GKACQC

Dependencies

  • [2] 44O46KDA Merge lines.love
  • [3] 2JBAEQHU Merge lines.love
  • [4] RAXUQQ6Z Merge lines.love
  • [5] 2344TV56 Merge lines.love
  • [6] 6XCJX4DZ bugfix: inscript's bug
  • [7] 5SM6DRHK port inscript's bugfix to source editor
  • [8] LF7BWEG4 group all editor globals
  • [9] WJBZZQE4 fold together two largely similar cases
  • [10] JOPVPUSA editing source code from within the app
  • [11] ORKN6EOB Merge lines.love
  • [12] QJISOCHJ some temporary logging to catch a bug
  • [13] 4YDBYBA4 clean up memory leak experiments
  • [14] OGUV4HSA remove some memory leaks from rendered fragments
  • [15] ZTZOO2OQ Merge lines.love
  • [16] APX2PY6G stop tracking wallclock time
  • [17] UD7HNQL7 purge unused button infrastructure
  • [18] VBU5YHLR Merge lines.love
  • [19] VXORMHME delete experimental REPL
  • [20] 4U4VQWNY Merge lines.love
  • [21] GFXWHTE6 mouse wheel support
  • [22] FKNXK2OA switch to line index in a function
  • [23] UHB4GARJ left/right margin -> left/right coordinates
  • [24] R5QXEHUI somebody stop me
  • [25] MTJEVRJR add state arg to a few functions
  • [26] ELJNEPW2 simplify cursor-on-screen check
  • [27] TXI6GSQD some minor cleanup
  • [28] 73OCE2MC after much struggle, a brute-force undo
  • [29] REAIVN7W Merge lines.love
  • [30] TVCPXAAU rename
  • [31] 52ZZ5TIE switch to line index in a function
  • [32] YFW4MNNP handle wrapping lines
  • [33] K2X6G75Z start writing some tests for drawings
  • [34] 2CTN2IEF Merge lines.love
  • [35] VHUNJHXB Merge lines.love
  • [36] 66X36NZN a little more prose describing manual_tests
  • [37] CE4LZV4T drop last couple of manual tests
  • [38] KKMFQDR4 editing source code from within the app
  • [39] MRA2Y3EE idea: set recent_mouse on mouse events
  • [40] ORRSP7FV deduce test names on failures
  • [41] BJ5X5O4A let's prevent the text cursor from ever getting on a drawing
  • [42] 4EGQRXDA bugfix: naming points
  • [43] A4BSGS2C Merge lines.love
  • [44] JZR3QMTN Merge lines.love
  • [45] B4JEWKWI hide editor cursor while in file navigator
  • [46] MU2HIRR6 Merge lines.love
  • [47] BW2IUB3K keep all text cache writes inside text.lua
  • [48] T4FRZSYL delete an ancient, unused file
  • [49] KMSL74GA support selections in the source editor
  • [50] MD3W5IRA new fork: rip out drawing support
  • [51] MUJTM6RE bring back a level of wrapping
  • [52] VHQCNMAR several more modules
  • [53] 2TQUKHBC Merge lines.love
  • [54] JDZVBFEI Merge lines.love
  • [55] ZLJYLPOT Merge lines.love
  • [56] HIKLULFQ extract a function
  • [57] FS2ITYYH record a known issue
  • [58] D76MS2G2 Merge lines.love
  • [59] VOU73AK6 Merge lines.love
  • [60] RSZD5A7G forgot to add json.lua
  • [61] 4KC7I3E2 make colors easier to edit
  • [62] LNUHQOGH start passing in Editor_state explicitly
  • [63] OI4FPFIN support drawings in the source editor
  • [64] 2CK5QI7W make love event names consistent
  • [65] 2L5MEZV3 experiment: new edit namespace
  • [66] HCFDBUXH fix stale comment
  • [67] LIKTH6HM update stale source X-(
  • [68] 6LJZN727 handle chords
  • [69] BULPIBEG beginnings of a module for the text editor
  • [70] G54H3YG2 get rid of all bifold text
  • [71] AVTNUQYR basic test-enabled framework
  • [72] LXTTOB33 extract a couple of files
  • [73] LDFXFRUO bring a few things in sync between run and source
  • [74] KWIVKQQ7 Merge lines.love
  • [75] KYNGDE2C consistent names in a few more places
  • [76] OB5XOXVC deemphasize the source editor
  • [77] OGD5RAQK bugfix: naming points in drawings
  • [78] N2NUGNN4 include a brief reference enabling many useful apps
  • [79] 7FPELAZB ah, I see the problem
  • [80] GNKUD23I get rid of recent_mouse
  • [81] JKENJ2UG Merge lines.love
  • [82] 3QNOKBFM beginnings of a test harness
  • [83] OTIBCAUJ love2d scaffold
  • [84] K6DTOGOQ flip return value of button handlers
  • [85] K74U4BAU Merge lines.love
  • [86] APYPFFS3 call edit rather than App callbacks in tests
  • [87] 4SR3Z4Y3 document the version of LÖVE I've been using
  • [88] BLWAYPKV extract a module
  • [89] OMLASW7K experiment at avoiding some merge conflicts
  • [90] 6RYLD5ON change how we handle clicks above top margin
  • [91] TLOAPLBJ add a license
  • [92] HNZMFBMQ Merge lines.love
  • [93] 6D5MOJS4 allow buttons to interrupt events
  • [94] QCPXQ2E3 add state arg to a few functions
  • [95] 32V6ZHQB Merge lines.love
  • [96] 3PSFWAIL Merge lines.love
  • [97] D4B52CQ2 Merge lines.love
  • [98] VP5KC4XZ Merge lines.love
  • [99] PK5U572C drop some extra args
  • [100] XX7G2FFJ intermingle freehand line drawings with text
  • [101] D2GCFTTT clean up repl functionality
  • [102] UUTUPEOJ extract a function
  • [103] SGMA5JLE save the list of tests in repo

Change contents

  • file deletion: source_text_tests.lua (----------)source_text_tests.lua (----------)
    [8.2][8.83676:83721](),[8.2][8.83676:83721](),[8.83721][8.3498:3498]()
    end
    function test_select_all_text()
    -- display a single line of text
    App.screen.init{width=75, height=80}
    Editor_state = edit.initialize_test_state()
    Editor_state.lines = load_array{'abc def'}
    Text.redraw_all(Editor_state)
    Editor_state.cursor1 = {line=1, pos=1}
    Editor_state.screen_top1 = {line=1, pos=1}
    Editor_state.screen_bottom1 = {}
    edit.draw(Editor_state)
    -- select all
    App.fake_key_press('lctrl')
    edit.run_after_keychord(Editor_state, 'C-a')
    App.fake_key_release('lctrl')
    edit.key_release(Editor_state, 'lctrl')
    -- selection
    check_eq(Editor_state.selection1.line, 1, 'selection:line')
    check_eq(Editor_state.selection1.pos, 1, 'selection:pos')
    check_eq(Editor_state.cursor1.line, 1, 'cursor:line')
    check_eq(Editor_state.cursor1.pos, 8, 'cursor:pos')
    end
    function test_select_text_using_mouse_starting_above_text_wrapping_line()
    -- first screen line starts in the middle of a line
    App.screen.init{width=50, height=60}
    Editor_state = edit.initialize_test_state()
    Editor_state.lines = load_array{'abc', 'defgh', 'xyz'}
    Text.redraw_all(Editor_state)
    Editor_state.cursor1 = {line=2, pos=5}
    Editor_state.screen_top1 = {line=2, pos=3}
    Editor_state.screen_bottom1 = {}
    -- press mouse above first line of text
    edit.run_after_mouse_press(Editor_state, Editor_state.left+8,5, 1)
    -- selection is at screen top
    check(Editor_state.selection1.line ~= nil, 'selection:line-not-nil')
    check_eq(Editor_state.selection1.line, 2, 'selection:line')
    check_eq(Editor_state.selection1.pos, 3, 'selection:pos')
    end
    function test_select_text_using_mouse_starting_below_text()
    -- I'd like to test what happens when a mouse click is below some page of
    -- text, potentially even in the middle of a line.
    -- However, it's brittle to set up a text line boundary just right.
    -- So I'm going to just check things below the bottom of the final line of
    -- text when it's in the middle of the screen.
    -- final screen line ends in the middle of screen
    App.screen.init{width=50, height=60}
    Editor_state = edit.initialize_test_state()
    Editor_state.lines = load_array{'abcde'}
    Text.redraw_all(Editor_state)
    Editor_state.cursor1 = {line=1, pos=1}
    Editor_state.screen_top1 = {line=1, pos=1}
    Editor_state.screen_bottom1 = {}
    edit.draw(Editor_state)
    local y = Editor_state.top
    App.screen.check(y, 'ab', 'baseline:screen:1')
    y = y + Editor_state.line_height
    App.screen.check(y, 'cde', 'baseline:screen:2')
    -- press mouse above first line of text
    edit.run_after_mouse_press(Editor_state, 5,App.screen.height-5, 1)
    -- selection is past bottom-most text in screen
    check(Editor_state.selection1.line ~= nil, 'selection:line-not-nil')
    check_eq(Editor_state.selection1.line, 1, 'selection:line')
    check_eq(Editor_state.selection1.pos, 6, 'selection:pos')
    end
    function test_select_text_using_mouse_and_shift()
    end
    function test_select_text_using_mouse_starting_above_text()
    App.screen.init{width=50, height=60}
    Editor_state = edit.initialize_test_state()
    Editor_state.lines = load_array{'abc', 'def', 'xyz'}
    Text.redraw_all(Editor_state)
    Editor_state.cursor1 = {line=1, pos=1}
    Editor_state.screen_top1 = {line=1, pos=1}
    Editor_state.screen_bottom1 = {}
    Editor_state.selection1 = {}
    edit.draw(Editor_state) -- populate line_cache.starty for each line Editor_state.line_cache
    -- press mouse above first line of text
    edit.run_after_mouse_press(Editor_state, Editor_state.left+8,5, 1)
    check(Editor_state.selection1.line ~= nil, 'selection:line-not-nil')
    check_eq(Editor_state.selection1.line, 1, 'selection:line')
    check_eq(Editor_state.selection1.pos, 1, 'selection:pos')
    end
    -- Arguably this should be called source_edit_tests.lua,
    -- but that would mess up the git blame at this point.
    function test_initial_state()
  • file deletion: source_text.lua (----------)source_text.lua (----------)
    [8.2][8.147062:147101](),[8.2][8.147062:147101](),[8.147101][8.83723:83723]()
    function Text.pos_at_end_of_screen_line(State, loc1)
    Text.populate_screen_line_starting_pos(State, loc1.line)
    local line_cache = State.line_cache[loc1.line]
    local most_recent_final_pos = utf8.len(State.lines[loc1.line].data)+1
    for i=#line_cache.screen_line_starting_pos,1,-1 do
    local spos = line_cache.screen_line_starting_pos[i]
    if spos <= loc1.pos then
    return most_recent_final_pos
    end
    most_recent_final_pos = spos-1
    end
    assert(false)
    end
    function Text.cursor_at_final_screen_line(State)
    Text.populate_screen_line_starting_pos(State, State.cursor1.line)
    -- result: pos, index of screen line
    function Text.pos_at_start_of_screen_line(State, loc1)
    Text.populate_screen_line_starting_pos(State, loc1.line)
    local line_cache = State.line_cache[loc1.line]
    for i=#line_cache.screen_line_starting_pos,1,-1 do
    local spos = line_cache.screen_line_starting_pos[i]
    if spos <= loc1.pos then
    return spos,i
    end
    end
    assert(false)
    end
  • file deletion: source_edit.lua (----------)source_edit.lua (----------)
    [8.2][8.165725:165764](),[8.2][8.165725:165764](),[8.165764][8.152440:152440]()
    --? print_and_log(('edit.mouse_release: finally selection %s,%s cursor %d,%d'):format(tostring(State.selection1.line), tostring(State.selection1.pos), State.cursor1.line, State.cursor1.pos))
    end
    end
    function edit.mouse_wheel_move(State, dx,dy)
    if dy > 0 then
    State.cursor1 = {line=State.screen_top1.line, pos=State.screen_top1.pos}
    for i=1,math.floor(dy) do
    Text.up(State)
    end
    --? print_and_log(('edit.mouse_release: cursor now %d,%d'):format(State.cursor1.line, State.cursor1.pos))
    if State.mousepress_shift then
    if State.old_selection1.line == nil then
    State.selection1 = State.old_cursor1
    else
    State.selection1 = State.old_selection1
    end
    end
    State.old_cursor1, State.old_selection1, State.mousepress_shift = nil
    if eq(State.cursor1, State.selection1) then
    State.selection1 = {}
    end
    break
    end
    end
    end
    --? print_and_log(('edit.mouse_release: in line %d'):format(line_index))
    State.cursor1 = {
    line=line_index,
    pos=Text.to_pos_on_line(State, line_index, x, y),
    }
    --? print_and_log('edit.mouse_release: no current drawing')
    for line_index,line in ipairs(State.lines) do
    if line.mode == 'text' then
    if Text.in_line(State, line_index, x,y) then
    --? print_and_log(('edit.mouse_release: cursor at %d,%d'):format(State.cursor1.line, State.cursor1.pos))
    if State.lines.current_drawing then
    -- still here? click is below all screen lines
    State.old_cursor1 = State.cursor1
    State.old_selection1 = State.selection1
    State.mousepress_shift = App.shift_down()
    State.selection1 = {
    line=State.screen_bottom1.line,
    pos=Text.pos_at_end_of_screen_line(State, State.screen_bottom1),
    }
    end
    return
    end
    return
    end
    elseif line.mode == 'drawing' then
    local line_cache = State.line_cache[line_index]
    if Drawing.in_drawing(line, line_cache, x, y, State.left,State.right) then
    State.lines.current_drawing_index = line_index
    State.lines.current_drawing = line
    Drawing.before = snapshot(State, line_index)
    --? print_and_log(('edit.mouse_press: in line %d'):format(line_index))
    State.old_cursor1 = State.cursor1
    State.old_selection1 = State.selection1
    State.mousepress_shift = App.shift_down()
    if y < State.top then
    State.old_cursor1 = State.cursor1
    State.old_selection1 = State.selection1
    State.mousepress_shift = App.shift_down()
    State.selection1 = {
    line=State.screen_top1.line,
    pos=State.screen_top1.pos,
    }
    return
    end
    for line_index,line in ipairs(State.lines) do
    --? print_and_log(('edit.mouse_press: cursor at %d,%d'):format(State.cursor1.line, State.cursor1.pos))
    if mouse_press_consumed_by_any_button_handler(State, x,y, mouse_button) then
    -- press on a button and it returned 'true' to short-circuit
    return
    end
    State.screen_bottom1 = screen_bottom1
    if State.search_term then
    Text.draw_search_bar(State)
    end
    end
    function edit.update(State, dt)
    y, screen_bottom1.pos = Text.draw(State, line_index, y, startpos, hide_cursor)
    --? print('=> y', y)
    elseif line.mode == 'drawing' then
    y = y+Drawing_padding_top
    Drawing.draw(State, line_index, y)
    y = y + Drawing.pixels(line.h, State.width) + Drawing_padding_bottom
    else
    print(line.mode)
    assert(false)
    screen_bottom1.line = line_index
    if line.mode == 'text' then
    local screen_bottom1 = {line=nil, pos=nil}
    --? print('== draw')
    for line_index = State.screen_top1.line,#State.lines do
    local line = State.lines[line_index]
  • file deletion: source.lua (----------)source.lua (----------)
    [8.2][8.177652:177686](),[8.2][8.177652:177686](),[8.177686][8.165766:165766]()
    function print_and_log(s)
    print(s)
    log(3, s)
    end
    function source.load_settings()
    local settings = Settings.source
    love.graphics.setFont(love.graphics.newFont(settings.font_height))
  • file deletion: run.lua (----------)run.lua (----------)
    [8.2][8.184046:184077](),[8.2][8.184046:184077](),[8.184077][8.178044:178044]()
    function print_and_log(s)
    print(s)
    log(3, s)
    end
    function run.load_settings()
    love.graphics.setFont(love.graphics.newFont(Settings.font_height))
  • edit in source_text_tests.lua at line 2
    [8.3600]
    [8.3600]
    -- Arguably this should be called source_edit_tests.lua,
    -- but that would mess up the git blame at this point.
  • edit in source_text_tests.lua at line 831
    [8.6905]
    [8.9170]
    end
    function test_select_text_using_mouse_starting_above_text()
    App.screen.init{width=50, height=60}
    Editor_state = edit.initialize_test_state()
    Editor_state.lines = load_array{'abc', 'def', 'xyz'}
    Text.redraw_all(Editor_state)
    Editor_state.cursor1 = {line=1, pos=1}
    Editor_state.screen_top1 = {line=1, pos=1}
    Editor_state.screen_bottom1 = {}
    Editor_state.selection1 = {}
    edit.draw(Editor_state) -- populate line_cache.starty for each line Editor_state.line_cache
    -- press mouse above first line of text
    edit.run_after_mouse_press(Editor_state, Editor_state.left+8,5, 1)
    check(Editor_state.selection1.line ~= nil, 'selection:line-not-nil')
    check_eq(Editor_state.selection1.line, 1, 'selection:line')
    check_eq(Editor_state.selection1.pos, 1, 'selection:pos')
  • edit in source_text_tests.lua at line 850
    [8.9175]
    [8.9175]
    function test_select_text_using_mouse_starting_above_text_wrapping_line()
    -- first screen line starts in the middle of a line
    App.screen.init{width=50, height=60}
    Editor_state = edit.initialize_test_state()
    Editor_state.lines = load_array{'abc', 'defgh', 'xyz'}
    Text.redraw_all(Editor_state)
    Editor_state.cursor1 = {line=2, pos=5}
    Editor_state.screen_top1 = {line=2, pos=3}
    Editor_state.screen_bottom1 = {}
    -- press mouse above first line of text
    edit.run_after_mouse_press(Editor_state, Editor_state.left+8,5, 1)
    -- selection is at screen top
    check(Editor_state.selection1.line ~= nil, 'selection:line-not-nil')
    check_eq(Editor_state.selection1.line, 2, 'selection:line')
    check_eq(Editor_state.selection1.pos, 3, 'selection:pos')
    end
    function test_select_text_using_mouse_starting_below_text()
    -- I'd like to test what happens when a mouse click is below some page of
    -- text, potentially even in the middle of a line.
    -- However, it's brittle to set up a text line boundary just right.
    -- So I'm going to just check things below the bottom of the final line of
    -- text when it's in the middle of the screen.
    -- final screen line ends in the middle of screen
    App.screen.init{width=50, height=60}
    Editor_state = edit.initialize_test_state()
    Editor_state.lines = load_array{'abcde'}
    Text.redraw_all(Editor_state)
    Editor_state.cursor1 = {line=1, pos=1}
    Editor_state.screen_top1 = {line=1, pos=1}
    Editor_state.screen_bottom1 = {}
    edit.draw(Editor_state)
    local y = Editor_state.top
    App.screen.check(y, 'ab', 'baseline:screen:1')
    y = y + Editor_state.line_height
    App.screen.check(y, 'cde', 'baseline:screen:2')
    -- press mouse above first line of text
    edit.run_after_mouse_press(Editor_state, 5,App.screen.height-5, 1)
    -- selection is past bottom-most text in screen
    check(Editor_state.selection1.line ~= nil, 'selection:line-not-nil')
    check_eq(Editor_state.selection1.line, 1, 'selection:line')
    check_eq(Editor_state.selection1.pos, 6, 'selection:pos')
    end
  • edit in source_text_tests.lua at line 946
    [8.7371]
    [8.33196]
    end
    function test_select_all_text()
    -- display a single line of text
    App.screen.init{width=75, height=80}
    Editor_state = edit.initialize_test_state()
    Editor_state.lines = load_array{'abc def'}
    Text.redraw_all(Editor_state)
    Editor_state.cursor1 = {line=1, pos=1}
    Editor_state.screen_top1 = {line=1, pos=1}
    Editor_state.screen_bottom1 = {}
    edit.draw(Editor_state)
    -- select all
    App.fake_key_press('lctrl')
    edit.run_after_keychord(Editor_state, 'C-a')
    App.fake_key_release('lctrl')
    edit.key_release(Editor_state, 'lctrl')
    -- selection
    check_eq(Editor_state.selection1.line, 1, 'selection:line')
    check_eq(Editor_state.selection1.pos, 1, 'selection:pos')
    check_eq(Editor_state.cursor1.line, 1, 'cursor:line')
    check_eq(Editor_state.cursor1.pos, 8, 'cursor:pos')
  • edit in source_text.lua at line 653
    [8.124465]
    [8.124784]
    -- result: pos, index of screen line
  • edit in source_text.lua at line 666
    [8.125684]
    [8.125684]
    function Text.pos_at_end_of_screen_line(State, loc1)
    Text.populate_screen_line_starting_pos(State, loc1.line)
    local line_cache = State.line_cache[loc1.line]
    local most_recent_final_pos = utf8.len(State.lines[loc1.line].data)+1
    for i=#line_cache.screen_line_starting_pos,1,-1 do
    local spos = line_cache.screen_line_starting_pos[i]
    if spos <= loc1.pos then
    return most_recent_final_pos
    end
    most_recent_final_pos = spos-1
    end
    assert(false)
    end
  • edit in source_edit.lua at line 79
    [8.23466][8.23466:23568]()
    -- when selecting text, avoid recomputing some state on every single frame
    recent_mouse = {},
  • edit in source_edit.lua at line 156
    [8.155825]
    [8.155825]
    local screen_bottom1 = {line=nil, pos=nil}
  • replacement in source_edit.lua at line 162
    [8.156055][8.8541:8595]()
    State.screen_bottom1 = {line=line_index, pos=nil}
    [8.156055]
    [8.18495]
    screen_bottom1.line = line_index
  • replacement in source_edit.lua at line 185
    [8.156405][8.8708:8799]()
    y, State.screen_bottom1.pos = Text.draw(State, line_index, y, startpos, hide_cursor)
    [8.156405]
    [8.19795]
    y, screen_bottom1.pos = Text.draw(State, line_index, y, startpos, hide_cursor)
  • edit in source_edit.lua at line 196
    [8.156588]
    [8.156588]
    State.screen_bottom1 = screen_bottom1
  • replacement in source_edit.lua at line 227
    [8.157214][8.395:436]()
    --? print('press', State.cursor1.line)
    [8.157214]
    [8.157280]
    --? print_and_log(('edit.mouse_press: cursor at %d,%d'):format(State.cursor1.line, State.cursor1.pos))
  • edit in source_edit.lua at line 233
    [8.157442]
    [8.157442]
    if y < State.top then
    State.old_cursor1 = State.cursor1
    State.old_selection1 = State.selection1
    State.mousepress_shift = App.shift_down()
    State.selection1 = {
    line=State.screen_top1.line,
    pos=State.screen_top1.pos,
    }
    return
    end
  • edit in source_edit.lua at line 256
    [8.5682]
    [8.24094]
    --? print_and_log(('edit.mouse_press: in line %d'):format(line_index))
  • replacement in source_edit.lua at line 264
    [8.9085][8.9085:9161](),[8.9161][8.20393:20407](),[8.24399][8.20393:20407](),[8.20393][8.20393:20407]()
    --? print('selection', State.selection1.line, State.selection1.pos)
    break
    [8.9085]
    [8.20407]
    return
  • replacement in source_edit.lua at line 273
    [8.5749][8.20810:20824](),[8.20810][8.20810:20824]()
    break
    [8.5749]
    [8.20824]
    return
  • edit in source_edit.lua at line 277
    [8.157756]
    [8.157756]
    -- still here? click is below all screen lines
    State.old_cursor1 = State.cursor1
    State.old_selection1 = State.selection1
    State.mousepress_shift = App.shift_down()
    State.selection1 = {
    line=State.screen_bottom1.line,
    pos=Text.pos_at_end_of_screen_line(State, State.screen_bottom1),
    }
  • replacement in source_edit.lua at line 290
    [8.20874][8.437:480]()
    --? print('release', State.cursor1.line)
    [8.20874]
    [8.20897]
    --? print_and_log(('edit.mouse_release: cursor at %d,%d'):format(State.cursor1.line, State.cursor1.pos))
  • edit in source_edit.lua at line 299
    [8.24407]
    [8.24407]
    --? print_and_log('edit.mouse_release: no current drawing')
  • replacement in source_edit.lua at line 303
    [8.24544][8.24544:24583]()
    --? print('reset selection')
    [8.24544]
    [8.9162]
    --? print_and_log(('edit.mouse_release: in line %d'):format(line_index))
  • replacement in source_edit.lua at line 308
    [8.9297][8.9297:9366]()
    --? print('cursor', State.cursor1.line, State.cursor1.pos)
    [8.9297]
    [8.24808]
    --? print_and_log(('edit.mouse_release: cursor now %d,%d'):format(State.cursor1.line, State.cursor1.pos))
  • replacement in source_edit.lua at line 324
    [8.25282][8.25282:25355]()
    --? print('selection:', State.selection1.line, State.selection1.pos)
    [8.25282]
    [8.11]
    --? print_and_log(('edit.mouse_release: finally selection %s,%s cursor %d,%d'):format(tostring(State.selection1.line), tostring(State.selection1.pos), State.cursor1.line, State.cursor1.pos))
  • edit in source.lua at line 116
    [8.168464]
    [8.168464]
    function print_and_log(s)
    print(s)
    log(3, s)
    end
  • resurrect zombie in select.lua at line 62
    [8.706][8.6274:6326](),[8.706][8.6274:6326]()
    local s = line.data:sub(lo_offset, hi_offset-1)
  • edit in run.lua at line 51
    [8.179202]
    [8.179202]
    function print_and_log(s)
    print(s)
    log(3, s)
    end
  • replacement in edit.lua at line 110
    [8.3095][8.37275:37329]()
    State.screen_bottom1 = {line=line_index, pos=nil}
    [8.3095]
    [8.9505]
    screen_bottom1.line = line_index
  • edit in edit.lua at line 115
    [8.9658][8.37331:37331](),[8.3095][6.1997:2034](),[8.3095][6.1997:2034](),[8.5239][6.2035:2107](),[8.5239][6.2035:2107]()
    screen_bottom1.line = line_index
    y, screen_bottom1.pos = Text.draw(State, line_index, y, startpos)
  • resolve order conflict in edit.lua at line 115
    [8.9658]
    [8.5845]
  • replacement in edit.lua at line 116
    [8.5853][8.9659:9735]()
    y, State.screen_bottom1.pos = Text.draw(State, line_index, y, startpos)
    [8.5853]
    [8.9765]
    y, screen_bottom1.pos = Text.draw(State, line_index, y, startpos)
  • edit in edit.lua at line 149
    [8.4581][8.84:125](),[8.4581][8.84:125]()
    --? print('press', State.cursor1.line)
  • resurrect zombie in edit.lua at line 149
    [8.7017][8.1049:1226](),[8.7017][8.1049:1226](),[8.1226][8.793:865](),[8.1226][8.793:865](),[8.865][8.1257:1281](),[8.1257][8.1257:1281](),[8.1257][8.1257:1281]()
    if y < State.top then
    State.old_cursor1 = State.cursor1
    State.old_selection1 = State.selection1
    State.mousepress_shift = App.shift_down()
    State.selection1 = {
    line=State.screen_top1.line,
    pos=State.screen_top1.pos,
    }
    return
    end
  • edit in edit.lua at line 149
    [8.4581]
    [8.1049]
    --? print_and_log(('edit.mouse_press: cursor at %d,%d'):format(State.cursor1.line, State.cursor1.pos))
  • replacement in edit.lua at line 171
    [8.10408][8.10408:10473]()
    -- i.e. mouse_released should never look at shift state
    [8.10408]
    [8.10473]
    -- i.e. mouse_release should never look at shift state
    --? print_and_log(('edit.mouse_press: in line %d'):format(line_index))
  • edit in edit.lua at line 180
    [8.10729][8.10729:10815](),[8.10815][8.8761:8761](),[8.4581][6.2149:2254](),[8.4581][6.2149:2254](),[8.7962][6.2255:2270](),[8.7962][6.2255:2270](),[8.788][6.2271:2286](),[8.788][6.2271:2286](),[8.788][6.2271:2286]()
    --? print('selection', State.selection1.line, State.selection1.pos)
    break
    --? print_and_log(('edit.mouse_press: cursor at %d,%d'):format(State.cursor1.line, State.cursor1.pos))
    return
    return
  • resolve order conflict in edit.lua at line 180
    [8.10729]
  • edit in edit.lua at line 180
    [0.6324]
    [8.8345]
    return
  • replacement in edit.lua at line 196
    [8.5338][8.28:71]()
    --? print('release', State.cursor1.line)
    [8.5338]
    [8.10816]
    --? print_and_log(('edit.mouse_release(%d,%d): cursor at %d,%d'):format(x,y, State.cursor1.line, State.cursor1.pos))
  • replacement in edit.lua at line 199
    [8.10913][8.10913:10948]()
    --? print('reset selection')
    [8.10913]
    [8.10948]
    --? print_and_log(('edit.mouse_release: in line %d'):format(line_index))
  • replacement in edit.lua at line 204
    [8.11067][8.11067:11132]()
    --? print('cursor', State.cursor1.line, State.cursor1.pos)
    [8.11067]
    [8.11132]
    --? print_and_log(('edit.mouse_release: cursor now %d,%d'):format(State.cursor1.line, State.cursor1.pos))
  • edit in edit.lua at line 210
    [8.11328][8.73:73](),[8.5338][6.2596:2703](),[8.5338][6.2596:2703](),[8.8804][6.2704:2768](),[8.8804][6.2704:2768]()
    --? print_and_log(('edit.mouse_release: cursor at %d,%d'):format(State.cursor1.line, State.cursor1.pos))
    --? print_and_log('edit.mouse_release: no current drawing')
  • resolve order conflict in edit.lua at line 210
    [8.11328]
    [8.9594]
  • edit in edit.lua at line 218
    [8.9624][6.2970:3165]()
    --? print_and_log(('edit.mouse_release: finally selection %s,%s cursor %d,%d'):format(tostring(State.selection1.line), tostring(State.selection1.pos), State.cursor1.line, State.cursor1.pos))
  • resurrect zombie in edit.lua at line 218
    [8.936][8.1864:1870](),[8.1241][8.1864:1870](),[6.3165][8.1864:1870](),[8.6276][8.1864:1870](),[8.6276][8.1864:1870]()
    end
  • edit in edit.lua at line 219
    [8.1870][8.1957:2028]()
    --? print('selection:', State.selection1.line, State.selection1.pos)
  • resurrect zombie in edit.lua at line 219
    [8.2028][8.1870:2073](),[8.1870][8.1870:2073](),[8.1870][8.1870:2073]()
    end
    function edit.mouse_wheel_move(State, dx,dy)
    if dy > 0 then
    State.cursor1 = {line=State.screen_top1.line, pos=State.screen_top1.pos}
    for i=1,math.floor(dy) do
    Text.up(State)
    end
  • edit in edit.lua at line 219
    [8.1870]
    [8.1870]
    --? print_and_log(('edit.mouse_release: finally selection %s,%s cursor %d,%d'):format(tostring(State.selection1.line), tostring(State.selection1.pos), State.cursor1.line, State.cursor1.pos))
  • resurrect zombie in edit.lua at line 229
    [8.182][8.2080:2225](),[8.2080][8.2080:2225](),[8.2080][8.2080:2225]()
    State.cursor1 = {line=State.screen_bottom1.line, pos=State.screen_bottom1.pos}
    for i=1,math.floor(-dy) do
    Text.down(State)
    end
  • edit in edit.lua at line 438
    [8.7287][2.29:29](),[8.258][6.2769:2852](),[8.258][6.2769:2852](),[8.9165][6.2853:2969](),[8.9165][6.2853:2969](),[8.5449][7.6169:6248](),[8.5449][7.6169:6248](),[8.5449][7.6169:6248]()
    --? print_and_log(('edit.mouse_release: in line %d'):format(line_index))
    --? print_and_log(('edit.mouse_release: cursor now %d,%d'):format(State.cursor1.line, State.cursor1.pos))
    --? print_and_log(('edit.mouse_press: in line %d'):format(line_index))
  • resolve order conflict in edit.lua at line 438
    [8.7287]