Merge lines.love

[?]
Sep 16, 2023, 6:56 AM
34BZ5ZKNAB4XQGXOPVBZHBDYD5D3X4V6T72XZSR5LJXF4UIVSWQAC

Dependencies

  • [2] MGJZHZC4 Merge lines.love
  • [3] AIHNAYF4 clean up a slight jitter when drawing circles
  • [4] NVSC4N4K change a helper slightly
  • [5] 2MGBV7NP bugfix: crash when using mouse wheel
  • [6] 4PHGNJN6 assume starty can be nil in update
  • [7] PXSQR2AD hide line numbers from log browser
  • [8] J5NTUS2G source: show file being edited in window title bar
  • [9] 2CK5QI7W make love event names consistent
  • [10] TLOAPLBJ add a license
  • [11] 3QNOKBFM beginnings of a test harness
  • [12] VOU73AK6 Merge lines.love
  • [13] KTZQ57HV replace globals with args in a few functions
  • [14] OI4FPFIN support drawings in the source editor
  • [15] 4U4VQWNY Merge lines.love
  • [16] KYNGDE2C consistent names in a few more places
  • [17] WB6SIB7H Merge lines.love
  • [18] CWQIPU7U always show line numbers in source editor
  • [19] 66X36NZN a little more prose describing manual_tests
  • [20] 2L5MEZV3 experiment: new edit namespace
  • [21] JOPVPUSA editing source code from within the app
  • [22] JFFUF5AL override mouse state lookups in tests
  • [23] BULPIBEG beginnings of a module for the text editor
  • [24] ERQKFTPV extract method
  • [25] ZLJYLPOT Merge lines.love
  • [26] OB5XOXVC deemphasize the source editor
  • [27] XX7G2FFJ intermingle freehand line drawings with text
  • [28] CEDTFKFD delete some dead code
  • [29] KMSL74GA support selections in the source editor
  • [30] OMLASW7K experiment at avoiding some merge conflicts
  • [31] BYKXF3YY bugfix: draw menu after everything else
  • [32] L2FWWEQL source: remember cursor position of multiple files
  • [33] 7VGDIPLC more robust state validation
  • [34] VHQCNMAR several more modules
  • [35] G54H3YG2 get rid of all bifold text
  • [36] AIBA4RWQ hide cursor in log browser window
  • [37] VHUNJHXB Merge lines.love
  • [38] SW7BSBMJ several bugfixes in saving/loading cursor position
  • [39] B6DS4GZC Merge lines.love
  • [40] RT6EV6OP delegate update events to drawings
  • [41] D2GCFTTT clean up repl functionality
  • [42] AF253GHL bugfix
  • [43] REAIVN7W Merge lines.love
  • [44] ONHKBLLC Merge lines.love
  • [45] D4B52CQ2 Merge lines.love
  • [46] U3MJNFUY Merge lines.love
  • [47] 3PSFWAIL Merge lines.love
  • [48] V5SYDHPQ start thinking of compute_fragments as a detail
  • [49] R5QXEHUI somebody stop me
  • [50] RSZD5A7G forgot to add json.lua
  • [51] IX5YTLSV state validation in source editor as well
  • [52] 3XNFQDDN Merge lines.love
  • [53] 73OCE2MC after much struggle, a brute-force undo
  • [54] PJEQCTBL add state arg to Drawing.update
  • [55] PTT4K4EU use the provided args everywhere
  • [56] X3CQLBTR set window title within each app
  • [57] VBU5YHLR Merge lines.love
  • [58] 2TQUKHBC Merge lines.love
  • [59] R3XGABER chunk up some long lines
  • [60] 2CTN2IEF Merge lines.love
  • [61] JZR3QMTN Merge lines.love
  • [62] ORKN6EOB Merge lines.love
  • [63] T4FRZSYL delete an ancient, unused file
  • [64] OGUV4HSA remove some memory leaks from rendered fragments
  • [65] OTIBCAUJ love2d scaffold
  • [66] P5QNVXSN drop final mention of state global beyond main.lua
  • [67] 3OTESDW6 move drawing.starty into line cache
  • [68] MD3W5IRA new fork: rip out drawing support
  • [69] TXI6GSQD some minor cleanup
  • [70] LIKTH6HM update stale source X-(
  • [71] LNUHQOGH start passing in Editor_state explicitly
  • [72] AYX33NBC Merge lines.love
  • [73] MU2HIRR6 Merge lines.love
  • [74] ZTK4QTZT extract a couple of functions
  • [75] ATQO62TF Merge lines.love
  • [76] KWIVKQQ7 Merge lines.love
  • [77] NYQ7HD4D move
  • [78] BJ5X5O4A let's prevent the text cursor from ever getting on a drawing
  • [79] VP5KC4XZ Merge lines.love
  • [80] 2344TV56 Merge lines.love
  • [81] LDFXFRUO bring a few things in sync between run and source
  • [82] 4VQGE7RA new test
  • [83] B4JEWKWI hide editor cursor while in file navigator
  • [84] W6XUYQKP source: show files in MRU order
  • [85] 4SR3Z4Y3 document the version of LÖVE I've been using
  • [86] TVCPXAAU rename
  • [87] SGMA5JLE save the list of tests in repo
  • [88] BLWAYPKV extract a module
  • [89] KKMFQDR4 editing source code from within the app
  • [90] LWPFEZBI Merge lines.love
  • [91] RU4HIK43 Merge lines.love
  • [92] FS2ITYYH record a known issue
  • [93] GX236KZG Revert "deemphasize the source editor"
  • [94] VXORMHME delete experimental REPL
  • [95] CE4LZV4T drop last couple of manual tests
  • [96] K2X6G75Z start writing some tests for drawings
  • [97] 4YDBYBA4 clean up memory leak experiments
  • [98] GFXWHTE6 mouse wheel support
  • [99] N2NUGNN4 include a brief reference enabling many useful apps
  • [100] 6LJZN727 handle chords
  • [101] AKZWDWIA Merge lines.love
  • [102] LXTTOB33 extract a couple of files
  • [103] GZ5WULJV switch source side to new screen-line-based render
  • [104] K74U4BAU Merge lines.love
  • [105] 5SM6DRHK port inscript's bugfix to source editor
  • [106] ED4Z6ORC cleaner API for file-system access
  • [107] AVTNUQYR basic test-enabled framework
  • [108] QQBP3G6W return height of editor widget after drawing

Change contents

  • file deletion: source_text.lua (----------)source_text.lua (----------)
    [9.2][9.147062:147101](),[9.2][9.147062:147101](),[9.147101][9.83723:83723]()
    if show_line_numbers then
    App.color(Line_number_color)
    love.graphics.print(line_index, State.left-Line_number_width*App.width('m')+10,y)
    end
    initialize_color()
    function Text.draw(State, line_index, y, startpos, hide_cursor, show_line_numbers)
    local line = State.lines[line_index]
    local line_cache = State.line_cache[line_index]
    line_cache.starty = y
    line_cache.startpos = startpos
  • file deletion: source_edit.lua (----------)source_edit.lua (----------)
    [9.2][9.165725:165764](),[9.2][9.165725:165764](),[9.165764][9.152440:152440]()
    left = math.floor(left), -- left margin for text; line numbers go to the left of this
    y, screen_bottom1.pos = Text.draw(State, line_index, y, startpos, hide_cursor, show_line_numbers)
    edit.put_cursor_on_next_text_line(State)
    edit.put_cursor_on_next_text_line(State)
    for i=1,math.floor(-dy) do
    Text.down(State)
    end
    for i=1,math.floor(dy) do
    Text.up(State)
    end
    --? 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)
    local buttonx = State.left-Margin_left+4
    if show_line_numbers then
    buttonx = 4 -- HACK: position draw buttons at a fixed x on screen
    end
    button(State, 'draw', {x=buttonx, y=y+4, w=12,h=12, color={1,1,0},
    icon = icon.insert_drawing,
    onpress1 = function()
    Drawing.before = snapshot(State, line_index-1, line_index)
    table.insert(State.lines, line_index, {mode='drawing', y=y, h=256/2, points={}, shapes={}, pending={}})
    table.insert(State.line_cache, line_index, {})
    if State.cursor1.line >= line_index then
    State.cursor1.line = State.cursor1.line+1
    end
    schedule_save(State)
    record_undo_event(State, {before=Drawing.before, after=snapshot(State, line_index-1, line_index+1)})
    end,
    })
    function edit.draw(State, hide_cursor, show_line_numbers)
    State.button_handlers = {}
    App.color(Text_color)
    right = math.floor(right),
    if State.lines[State.cursor1.line].mode == 'text' then
    break
    end
    State.cursor1.line = State.cursor1.line+1
    State.cursor1.pos = 1
    end
    end
    function edit.put_cursor_on_next_text_line(State)
    while true do
    if State.cursor1.line >= #State.lines then
    break
    end
    edit.put_cursor_on_next_text_line(State)
    end
    end
    function edit.invalid1(State, loc1)
  • file deletion: source.lua (----------)source.lua (----------)
    [9.2][9.177652:177686](),[9.2][9.177652:177686](),[9.177686][9.165766:165766]()
    edit.draw(Editor_state, --[[hide cursor?]] Show_file_navigator, --[[show line numbers]] true)
    if Show_log_browser_side then
    -- divider
    App.color(Divider_color)
    love.graphics.rectangle('fill', App.screen.width/2-1,Menu_status_bar_height, 3,App.screen.height)
    --
    love.window.setTitle('lines.love - source - '..Editor_state.filename)
  • file deletion: commands.lua (----------)commands.lua (----------)
    [9.2][9.207726:207762](),[9.2][9.207726:207762](),[9.207762][9.204370:204370]()
    source.switch_to_file(s..'.lua')
    love.window.setTitle('lines.love - source - '..Editor_state.filename)
    reset_file_navigator()
  • replacement in source_text.lua at line 6
    [9.128][9.1043:1107](),[9.1043][9.1043:1107]()
    function Text.draw(State, line_index, y, startpos, hide_cursor)
    [9.128]
    [9.84161]
    function Text.draw(State, line_index, y, startpos, hide_cursor, show_line_numbers)
  • replacement in source_text.lua at line 15
    [9.254][2.8:123]()
    App.color(Line_number_color)
    love.graphics.print(line_index, State.left-Line_number_width*App.width('m')+10,y)
    [9.254]
    [9.87472]
    if show_line_numbers then
    App.color(Line_number_color)
    love.graphics.print(line_index, State.left-Line_number_width*App.width('m')+10,y)
    end
  • replacement in source_edit.lua at line 92
    [9.155033][9.8338:8367]()
    left = math.floor(left),
    [9.155033]
    [9.8367]
    left = math.floor(left), -- left margin for text; line numbers go to the left of this
  • replacement in source_edit.lua at line 118
    [9.391][9.391:437]()
    edit.put_cursor_on_first_text_line(State)
    [9.391]
    [9.437]
    edit.put_cursor_on_next_text_line(State)
  • replacement in source_edit.lua at line 134
    [9.714][9.714:765](),[9.765][9.18307:18378](),[9.18307][9.18307:18378](),[9.18378][9.766:804](),[9.804][9.18407:18427](),[9.18407][9.18407:18427]()
    function edit.put_cursor_on_first_text_line(State)
    for i,line in ipairs(State.lines) do
    if line.mode == 'text' then
    State.cursor1 = {line=i, pos=1}
    break
    end
    [9.714]
    [9.18427]
    function edit.put_cursor_on_next_text_line(State)
    while true do
    if State.cursor1.line >= #State.lines then
    break
    end
    if State.lines[State.cursor1.line].mode == 'text' then
    break
    end
    State.cursor1.line = State.cursor1.line+1
    State.cursor1.pos = 1
  • replacement in source_edit.lua at line 147
    [9.18438][9.199:238]()
    function edit.draw(State, hide_cursor)
    [9.18438]
    [9.155439]
    function edit.draw(State, hide_cursor, show_line_numbers)
  • replacement in source_edit.lua at line 176
    [9.18866][2.171:240]()
    button(State, 'draw', {x=4, y=y+4, w=12,h=12, color={1,1,0},
    [9.18866]
    [9.18934]
    local buttonx = State.left-Margin_left+4
    if show_line_numbers then
    buttonx = 4 -- HACK: position draw buttons at a fixed x on screen
    end
    button(State, 'draw', {x=buttonx, y=y+4, w=12,h=12, color={1,1,0},
  • replacement in source_edit.lua at line 194
    [9.156405][9.4340:4425]()
    y, screen_bottom1.pos = Text.draw(State, line_index, y, startpos, hide_cursor)
    [9.156405]
    [9.19795]
    y, screen_bottom1.pos = Text.draw(State, line_index, y, startpos, hide_cursor, show_line_numbers)
  • edit in source_edit.lua at line 340
    [9.161]
    [9.161]
    edit.put_cursor_on_next_text_line(State)
  • edit in source_edit.lua at line 346
    [9.324]
    [9.324]
    edit.put_cursor_on_next_text_line(State)
  • replacement in source.lua at line 77
    [9.104][9.11:56](),[9.167379][9.11:56]()
    love.window.setTitle('text.love - source')
    [9.104]
    [9.105]
    love.window.setTitle('text.love - source - '..Editor_state.filename)
  • replacement in source.lua at line 240
    [9.172910][9.538:604]()
    edit.draw(Editor_state, --[[hide cursor?]] Show_file_navigator)
    [9.172910]
    [9.172961]
    edit.draw(Editor_state, --[[hide cursor?]] Show_file_navigator, --[[show line numbers]] true)
  • edit in log_browser.lua at line 38
    [9.1049][9.192680:192730](),[9.192680][9.192680:192730]()
    line.filename = guess_source(line.filename)
  • edit in log_browser.lua at line 75
    [9.194046][9.194046:194243]()
    end
    function guess_source(filename)
    local possible_source = filename:gsub('%.lua$', '%.splua')
    if file_exists(possible_source) then
    return possible_source
    else
    return filename
    end
  • edit in edit.lua at line 80
    [9.472][4.345:390]()
    edit.put_cursor_on_next_text_line(State)
  • resurrect zombie in edit.lua at line 80
    [4.390][9.518:565](),[9.955][9.518:565](),[9.518][9.518:565](),[9.518][9.518:565]()
    end
    end
    function edit.invalid1(State, loc1)
  • resolve order conflict in edit.lua at line 80
    [9.955]
    [9.518]
  • resurrect zombie in edit.lua at line 98
    [9.754][9.790:795](),[9.790][9.790:795](),[9.790][9.790:795]()
    end
  • edit in edit.lua at line 100
    [9.795][4.391:512](),[9.795][4.391:512](),[9.361][4.513:660](),[9.361][4.513:660]()
    function edit.put_cursor_on_next_text_line(State)
    while true do
    if State.cursor1.line >= #State.lines then
    break
    if State.lines[State.cursor1.line].mode == 'text' then
    break
    end
    State.cursor1.line = State.cursor1.line+1
    State.cursor1.pos = 1
    end
  • edit in drawing.lua at line 194
    [9.17584]
    [9.17584]
    local r = round(geom.dist(center.x, center.y, mx, my))
  • replacement in drawing.lua at line 196
    [9.17629][9.17629:17716]()
    love.graphics.circle('line', cx,cy, geom.dist(cx,cy, App.mouse_x(),App.mouse_y()))
    [9.17629]
    [9.17716]
    love.graphics.circle('line', cx,cy, Drawing.pixels(r, width))
  • edit in drawing.lua at line 221
    [9.3637][3.31:90](),[9.3637][3.31:90](),[9.2104][3.91:157](),[9.2104][3.91:157]()
    local r = round(geom.dist(center.x, center.y, mx, my))
    love.graphics.circle('line', cx,cy, Drawing.pixels(r, width))
  • resolve order conflict in drawing.lua at line 221
    [9.18674]
    [9.883]
  • edit in drawing.lua at line 252
    [9.20230]
    [9.20230]
    if line_cache.starty == nil then
    -- some event cleared starty just this frame
    -- draw in this frame will soon set starty
    -- just skip this frame
    return
    end
  • edit in drawing.lua at line 301
    [9.2924][6.31:207](),[9.2924][6.31:207]()
    if line_cache.starty == nil then
    -- some event cleared starty just this frame
    -- draw in this frame will soon set starty
    -- just skip this frame
    return
    end
  • resolve order conflict in drawing.lua at line 301
    [9.21692]
    [9.7466]
  • replacement in commands.lua at line 132
    [9.3002][9.3002:3081]()
    local candidate = guess_source(s..'.lua')
    source.switch_to_file(candidate)
    [9.3002]
    [9.3081]
    source.switch_to_file(s..'.lua')
    love.window.setTitle('lines.love - source - '..Editor_state.filename)