Merge upstream into main

[?]
Jun 20, 2022, 8:42 PM
27DROQW2CHKBMWQCCR7N7VK54P3HE7MESZIJSJ32JTPKEE23WJPAC

Dependencies

  • [2] BW6YXB6W stop recording points for arcs
  • [3] HHW3B3WF .
  • [4] DDXXXXBR new mode for polygons
  • [5] NONKKVVP update Readme for this fork
  • [6] SDVBZT66 tailor some copy to this fork
  • [7] BPL2TDWH document one more shortcut
  • [8] 4PHDQ5L5 correct commit f3abc2cbf2
  • [9] WCU5H2FE clean up
  • [10] 7XKWT5Y5 correct location of the line width slider
  • [11] 23DEB6JL make sure to save right when quitting
  • [12] GXEM6FP6 typos
  • [13] CZB4CK2R bugfix
  • [14] BU3U7TIJ clearer copy
  • [15] NVSWVPW5 move
  • [16] NUCZBE77 bugfix: alignment of help screen
  • [17] IEHG6ORO new fork for #1
  • [18] UEE5W7WJ document one more shortcut
  • [19] LYN3L74W correct commit f3abc2cbf2
  • [20] WPW3AVFS more precise shape selection
  • [21] BZRRUIFQ correct location of the line width slider
  • [22] VIU2FBNV make sure to save right when quitting
  • [23] KICO5EE5 typos
  • [24] AVLAYODP much simpler
  • [25] QZH3PQFU .
  • [26] RTDYYP4H bugfix: text past cursor was rendered red on wrapped lines
  • [27] B4YZWV6S bugfix: checking if a point is on a manhattan line
  • [28] 5DOC2CBM extract a function
  • [29] NP7PIUBT bugfix: restore state after C-f (find)
  • [30] ZLJGZYQG select text with shift + mouseclick
  • [31] 42LVB4DE test: naming a point
  • [32] MDXGMZU2 disable all debug prints
  • [33] 6UZ2JNZE yet another key conflict
  • [34] 7CLGG7J2 test: autosave after any shape
  • [35] W7JMT5V2 rip out most support for polygons
  • [36] JY4VK7L2 rename
  • [37] V366JSXA videos
  • [38] 4C375P53 this is a bit clearer
  • [39] DGK5BPVI bugfix: UTF-8 in compute_fragments
  • [40] SHEGBK4H while we're at it, undo naming points
  • [41] 242L3OQX bugfix: ensure Cursor_line is always on a text line
  • [42] OAHNWDYG .
  • [43] 7DYUAOI6 test: undo moving point
  • [44] 66X36NZN a little more prose describing manual_tests
  • [45] RSZD5A7G forgot to add json.lua
  • [46] KAUD3YIK tests: deleting points/shapes
  • [47] XX7G2FFJ intermingle freehand line drawings with text
  • [48] TLOAPLBJ add a license
  • [49] DXT4QTAH a few more integer coordinates
  • [50] BOFNXP5G clicking now moves the cursor even on long, wrapped lines
  • [51] CUIV2LE5 some typos
  • [52] IRCKL6VN extract scrolling logic out of insert_at_cursor
  • [53] UGYRO7TO forgot to commit documentation for the commandline arg
  • [54] SR7L4QPZ revert previous commit
  • [55] DLQMM265 scroll past first page
  • [56] 7IKRRESB longer names for indices in long loops
  • [57] HYEAFRZ2 split mouse_pressed events between Text and Drawing
  • [58] GY6LTMIJ more precise shape selection
  • [59] BERHYBXM fix help for rectangles and squares
  • [60] ESETRNLB bugfix: printing the first part of a line at the bottom made it seem non-wrapping
  • [61] L6XA5EY2 test: moving a point
  • [62] 3ZYCPNQY clearer copy
  • [63] 6DE7RBZ6 move mouse_released events to Drawing
  • [64] WTDKUACN rectangle and square shapes
  • [65] LXTTOB33 extract a couple of files
  • [66] GN3IF4WF bugfix: pasting newlines
  • [67] 65XHTZEK regression: couldn't do many drawing operations because line.y was reset
  • [68] 3GFQP6IR stop saving the entire file when modifying drawings
  • [69] 4ZM74KYL indent
  • [70] NFCBIEZD affordance to adjust width for word wrap
  • [71] CE4LZV4T drop last couple of manual tests
  • [72] VG75U7IM bugfix: typing should delete highlighted text
  • [73] XOAHJ6M3 similar tests for cursor up
  • [74] F63Q4OV7 several bugfixes
  • [75] 7OUJM7DL one missing transition between shape modes
  • [76] FHSZYAZ2 more precise search highlighting
  • [77] SRVDX4I5 local var
  • [78] BYG5CEMV support for naming points
  • [79] B3IWYWSR delete another arg that can be deduced
  • [80] CPZGQT72 go through and fix similar issues
  • [81] WIPDCP4U stop recording points for arcs
  • [82] 7M5PGWKU drop last couple of manual tests
  • [83] CG3264MM move
  • [84] 2ZYV7D3W handle tab characters
  • [85] OWK3U6VD tests for drawing polygons
  • [86] R5QXEHUI somebody stop me
  • [87] EQP53UQV autosave slightly less aggressively
  • [88] AOIRVVJA revert selection logic to before commit 3ffc2ed8f
  • [89] ULKLJBN6 couple of renames
  • [90] QKAMUWSB another bugfix in scrolling while inserting text
  • [91] YKRF5V3Z starting to load/save
  • [92] U7M4M2F7 bugfix: don't rely on Screen_bottom1 while scrolling
  • [93] HIKLULFQ extract a function
  • [94] T7IWZFL4 more precise scroll on paste
  • [95] 4VKEE43Z bugfix
  • [96] 73OCE2MC after much struggle, a brute-force undo
  • [97] K2X6G75Z start writing some tests for drawings
  • [98] 4YDBYBA4 clean up memory leak experiments
  • [99] NQWWTGXR switch undo/redo to ctrl- hotkeys
  • [100] 2RXZ3PGO beginning of a new approach to scroll+wrap
  • [101] VXORMHME delete experimental REPL
  • [102] CZRMAMSB clearer discription of how to run lines.love
  • [103] U76D4P36 fix a typo
  • [104] ZUOL7X6V move
  • [105] BLWAYPKV extract a module
  • [106] TVCPXAAU rename
  • [107] AYE2VEGJ extract a couple of methods
  • [108] CRYGI3LR more drawing tests
  • [109] 6LJZN727 handle chords
  • [110] NEXUNNCF extract a function
  • [111] T7SJSJIH test: undo naming a point
  • [112] YHB3IX5O tweak to Readme
  • [113] ZRKTXF4Q tweak to Readme
  • [114] EMHRPJ3R no, that's not right
  • [115] OYXDYPGS get rid of debug variables
  • [116] K464QQR4 more defensive resize handling
  • [117] D2GCFTTT clean up repl functionality
  • [118] IDGP4BJZ new known issue with drawings
  • [119] LGD2F7UV better handle moving points
  • [120] DRFE3B3Z mouse buttons are integers, not strings
  • [121] PR4KIAZD first stab at equally hacky cursor down support
  • [122] LAW2O3NW extract variable Margin_left
  • [123] 4MXCZQ6E new icon for polygons
  • [124] FYS7TCDW bugfix
  • [125] 253TWKDA clean up
  • [126] MGOQ5XAV start uppercasing globals
  • [127] T4FRZSYL delete an ancient, unused file
  • [128] PFT5Y2ZY move
  • [129] HOSPP2AN crisp font rendering
  • [130] XHGO5TGM switch lines to digit shortcuts as well
  • [131] AVFRVNFR better handle moving points
  • [132] 537TQ2QN some more logging
  • [133] IMEJA43L snapshot
  • [134] H2DPLWMV snapshot: wrapping long lines at word boundaries
  • [135] SQLVYKVJ rename
  • [136] 6LIPEQ5I more robust transitions to temporary modes
  • [137] JF5L2BBS test harness now supports copy/paste
  • [138] AJB4LFRB try to maintain a reasonable line width
  • [139] 6VQIWTQU standardize on ordering of cases
  • [140] OLZRJ4AX experiment: use digits to draw regular polygons
  • [141] RF5ALVNY allow the window to be resized
  • [142] 2ENZW7TV select text using mouse drag
  • [143] 3TFEAQSW start using some globals
  • [144] YW2GO3U4 bugfix: crash in Text.up() after return
  • [145] 4WAFGF4Z selection bugfix
  • [146] AVTNUQYR basic test-enabled framework
  • [147] J2SVGR2E experiment: blinking cursor
  • [148] Z4XRNDTR find text
  • [149] 3QNOKBFM beginnings of a test harness
  • [150] BTKAW76L rename
  • [151] 5BJCYYHN convert videos to gif so they render inline on GitHub
  • [152] IDG26SXK bugfix in commit e51ce12969
  • [153] 2POFQQLW keep cursor on screen when pressing 'down'
  • [154] VJ77YABH more efficient undo/redo
  • [155] 3TTAYXPP cleanup
  • [156] YW5324Q3 bugfix: cut (C-x) without first selecting anything
  • [157] KEPVDTCG .
  • [158] BU3LUPY3 bugfix in help
  • [159] DHCLUDCW .
  • [160] RMKMPFT5 fix a corner case when selecting text
  • [161] WSXSEZQ2 switch circles to 'o' to avoid conflicting with copy
  • [162] PX7DDEMO autosave slightly less aggressively
  • [163] DHI6IJCN selecting text and deleting selections
  • [164] LS55YKGW switch copy/paste to ctrl- hotkeys
  • [165] 3TDOZESE extract scrolling logic out of insert_return
  • [166] 4AXV2HG4 all pending manual tests done!
  • [167] DAENUOGV eliminate assumptions that line length == size in bytes
  • [168] 5L7K4GBD clicking to the right of a wrapped line
  • [169] BJ5X5O4A let's prevent the text cursor from ever getting on a drawing
  • [170] RT6EV6OP delegate update events to drawings
  • [171] 4J2WLDRM indent
  • [172] YTSPVDZH first successful pagedown test, first bug found by test
  • [173] OTIBCAUJ love2d scaffold
  • [174] ZPUQSPQP extract a few methods
  • [175] JCSLDGAH beginnings of support for multiple shapes
  • [176] KVHUFUFV reorg
  • [177] GSV7DABC make online help fit within a drawing
  • [178] JZKEIKO6 freudian typo
  • [179] NQKFQSZE undo creating new drawings
  • [180] VC2CU2GG faster paste
  • [181] VHQCNMAR several more modules
  • [182] TVM2WIHH bugfix: autosave and undo in a couple of cases
  • [183] JRLBUB6L more intuitive point delete from polygons
  • [184] UWNHC4AA redo y computations
  • [185] NQH7DEEW bugfix: missed rename in one file
  • [186] V5MJRFOZ bugfix: down arrow doesn't scroll up unnecessarily
  • [187] CCYSVZA2 bugfix: BSOD in #4.
  • [188] SLLR6KKI bugfix for non-ASCII
  • [189] D4FEFHQC flesh out Readme
  • [190] VA2ZYFFF better fix for commit 3ffc2ed8f
  • [191] IHHNPJ5Q move
  • [192] SGMDI4TC bugfix: alignment of help screen
  • [193] NZKYPBSK check for scroll when just typing
  • [194] SN2QONLI autosave on cut/paste
  • [195] FS2ITYYH record a known issue
  • [196] XSLCFVFH .
  • [197] JFFUF5AL override mouse state lookups in tests
  • [198] 3OKKTUT4 up and down arrow now moving by screen line where possible
  • [199] JAXPXLEB set current_drawing_index with current_drawing
  • [200] DR5XD5JQ per-polygon icons
  • [201] 6J3NXBYG affordance to adjust width for word wrap
  • [202] 2MA33THZ few more transitions between shapes
  • [203] MP2TBKU6 bugfix: crash in Text.up() after return
  • [204] 2INHXC3K position cursor by clicking on text
  • [205] WDMPH4AN drop support for squares
  • [206] XVR2O5PI change text cursor shape
  • [207] WIDXZBNW experiment: extremely precise scrolling on paste
  • [208] BULPIBEG beginnings of a module for the text editor
  • [209] F3OOGMME switch freehand hotkey to eliminate conflict with search
  • [210] OGUV4HSA remove some memory leaks from rendered fragments
  • [211] HRWN5V6J Devine's suggestion to try to live with just freehand
  • [212] UFIUYYYV additional logging for an active bug
  • [213] YCDYGEZU include drawing index in a few places
  • [214] PGZJ6NAT ensure Filename is writable when opened outside a terminal
  • [215] AD34IX2Z couple more tests
  • [216] XNFTJHC4 split keyboard handling between Text and Drawing
  • [217] Y4VYNEGF test: autosave after name/move/delete of point

Change contents

  • file deletion: main_tests.lua (----------)
    [25.2][25.1125:1163](),[25.1163][25.7:7]()
    function test_resize_window()
    io.write('\ntest_resize_window')
    Filename = 'foo'
    App.screen.init{width=Margin_left+300, height=300}
    check_eq(App.screen.width, Margin_left+300, 'F - test_resize_window/baseline/width')
    check_eq(App.screen.height, 300, 'F - test_resize_window/baseline/height')
    App.resize(200, 400)
    check_eq(App.screen.width, 200, 'F - test_resize_window/width')
    check_eq(App.screen.height, 400, 'F - test_resize_window/height')
    -- TODO: how to make assertions about when App.update got past the early exit?
    end
    function test_adjust_line_width()
    io.write('\ntest_adjust_line_width')
    Filename = 'foo'
    App.screen.init{width=Margin_left+300, height=300}
    Line_width = 256
    App.draw() -- initialize button
    -- no change for some time
    App.wait_fake_time(0.01)
    App.update(0)
    check_eq(Line_width, 256, 'F - test_adjust_line_width/early')
    -- after 0.1s the change takes
    App.wait_fake_time(0.1)
    App.update(0)
    check_eq(Line_width, 200, 'F - test_adjust_line_width')
    end
    App.run_after_mouse_press(256, Margin_top-3, 1)
    App.mouse_move(200, 37)
  • edit in text_tests.lua at line 189
    [13.7][13.7:669](),[25.1122][25.2:7]()
    function test_edit_after_click_resets_selection()
    io.write('\ntest_edit_after_click_resets_selection')
    -- display a line of text
    App.screen.init{width=80, height=80}
    Lines = load_array{'abc'}
    Line_width = 75
    Cursor1 = {line=1, pos=1}
    Screen_top1 = {line=1, pos=1}
    Screen_bottom1 = {}
    App.draw()
    -- click past the end of it and hit enter
    App.run_after_mouse_click(Margin_left+40,Margin_top+5, 1)
    check(Selection1.line, 'F - test_edit_after_click_resets_selection/baseline')
    App.run_after_keychord('return')
    -- selection is reset since shift key is not pressed
    check_nil(Selection1.line, 'F - test_edit_after_click_resets_selection')
    end
  • resolve order conflict in text_tests.lua at line 189
    [13.7]
    [25.7]
  • edit in text.lua at line 17
    [25.141][10.3:72]()
    --? love.graphics.line(Line_width,0, Line_width,App.screen.height)
  • edit in text.lua at line 117
    [25.910][25.3:77]()
    local boffset = Text.offset(frag, bpos+1) -- byte _after_ bpos
  • resolve order conflict in text.lua at line 117
    [25.77]
    [25.1010]
  • edit in text.lua at line 160
    [25.99][25.78:151]()
    local byte_offset = Text.offset(Lines[Cursor1.line].data, Cursor1.pos)
  • edit in text.lua at line 169
    [25.627][13.671:732]()
    --? print('chord', chord, Selection1.line, Selection1.pos)
  • edit in text.lua at line 180
    [25.113][25.3:23]()
    schedule_save()
  • resolve order conflict in text.lua at line 180
    [25.23]
    [25.1422]
  • edit in text.lua at line 191
    [25.814][25.24:44]()
    schedule_save()
  • resolve order conflict in text.lua at line 191
    [25.44]
    [25.1548]
  • edit in text.lua at line 195
    [25.8453][25.45:67]()
    schedule_save()
  • edit in text.lua at line 233
    [25.216][25.68:88]()
    schedule_save()
  • resolve order conflict in text.lua at line 233
    [25.88]
    [25.1774]
  • edit in text.lua at line 238
    [25.8533][25.89:111]()
    schedule_save()
  • resolve order conflict in text.lua at line 238
    [25.111]
    [25.8533]
  • edit in text.lua at line 268
    [25.3922][25.112:132]()
    schedule_save()
  • edit in text.lua at line 354
    [25.223][25.174:247]()
    local byte_offset = Text.offset(Lines[Cursor1.line].data, Cursor1.pos)
  • edit in text.lua at line 436
    [25.1520][25.248:361]()
    local screen_line_starting_byte_offset = Text.offset(Lines[Cursor1.line].data, screen_line_starting_pos)
  • edit in text.lua at line 456
    [25.2441][25.362:479]()
    local new_screen_line_starting_byte_offset = Text.offset(Lines[Cursor1.line].data, new_screen_line_starting_pos)
  • resolve order conflict in text.lua at line 456
    [25.479]
    [25.421]
  • edit in text.lua at line 494
    [25.4338][25.480:597]()
    local new_screen_line_starting_byte_offset = Text.offset(Lines[Cursor1.line].data, new_screen_line_starting_pos)
  • edit in text.lua at line 512
    [25.5061][25.598:668]()
    local offset = Text.offset(Lines[Cursor1.line].data, Cursor1.pos)
  • edit in text.lua at line 525
    [25.5383][25.669:739]()
    local offset = Text.offset(Lines[Cursor1.line].data, Cursor1.pos)
  • resolve order conflict in text.lua at line 525
    [25.739]
    [25.10688]
  • edit in text.lua at line 665
    [25.133][25.740:836]()
    local screen_line_starting_byte_offset = Text.offset(line.data, screen_line_starting_pos)
  • resolve order conflict in text.lua at line 665
    [25.836]
    [25.910]
  • edit in text.lua at line 770
    [25.360][25.837:874]()
    local offset = Text.offset(s, pos)
  • resolve order conflict in text.lua at line 770
    [25.874]
    [25.414]
  • resolve order conflict in text.lua at line 834
    [25.1157]
    [25.875]
  • edit in text.lua at line 836
    [25.880][25.880:1157](),[25.1157][25.559:564](),[25.1157][25.559:564](),[25.559][25.559:564]()
    function Text.offset(s, pos1)
    if pos1 == 1 then return 1 end
    local result = utf8.offset(s, pos1)
    if result == nil then
    print(Cursor1.line, Cursor1.pos, #Lines[Cursor1.line].data, Lines[Cursor1.line].data)
    print(pos1, #s, s)
    end
    assert(result)
    return result
    end
  • edit in select.lua at line 58
    [25.242][25.1160:1309]()
    local lo_offset = Text.offset(line.data, lo)
    local hi_offset = Text.offset(line.data, hi)
    local pos_offset = Text.offset(line.data, pos)
  • edit in select.lua at line 140
    [25.47373][25.1310:1424]()
    local min_offset = Text.offset(Lines[minl].data, minp)
    local max_offset = Text.offset(Lines[maxl].data, maxp)
  • edit in select.lua at line 168
    [25.48224][25.1425:1539]()
    local min_offset = Text.offset(Lines[minl].data, minp)
    local max_offset = Text.offset(Lines[maxl].data, maxp)
  • edit in main.lua at line 14
    [25.78][25.1165:1187]()
    require 'main_tests'
  • edit in main.lua at line 84
    [25.63][25.137:153]()
    Next_save = nil
  • resolve order conflict in main.lua at line 84
    [25.153]
    [25.1567]
  • resolve order conflict in main.lua at line 102
    [25.55]
    [25.7]
  • edit in main.lua at line 103
    [25.8][25.8:55](),[25.55][25.8163:8164](),[25.55][25.8163:8164](),[25.196][25.8163:8164](),[25.240][25.8163:8164](),[25.455][25.8163:8164](),[25.2017][25.8163:8164](),[25.2680][25.8163:8164](),[25.8163][25.8163:8164]()
    -- line-width indicator
    Line_width_hover = nil
  • edit in main.lua at line 174
    [25.41][25.1188:1214]()
    function App.resize(w, h)
  • edit in main.lua at line 180
    [25.217][25.154:189]()
    Last_resize_time = App.getTime()
  • resolve order conflict in main.lua at line 180
    [25.189]
    [25.690]
  • edit in main.lua at line 219
    [25.324][25.190:241]()
    if App.getTime() - Last_resize_time < 0.1 then
  • edit in main.lua at line 225
    [25.447][25.447:448](),[25.448][25.56:82](),[25.82][10.155:237](),[10.237][25.176:273](),[25.176][25.176:273]()
    -- line-width indicator
    button('line-width', {x=Line_width-4,y=Margin_top-10, w=10,h=10, color={1,1,1},
    icon = icon.line_width,
    onpress1 = function() Line_width_hover = App.getTime() end,
    })
  • resolve order conflict in main.lua at line 226
    [25.274]
    [25.56]
  • edit in main.lua at line 245
    [25.38][25.275:305]()
    -- insert new drawing
  • resolve order conflict in main.lua at line 245
    [25.305]
    [25.759]
  • edit in main.lua at line 254
    [25.1148][25.242:281]()
    schedule_save()
  • resolve order conflict in main.lua at line 254
    [25.281]
    [25.284]
  • edit in main.lua at line 255
    [25.394][25.306:342](),[25.342][25.7:132](),[25.1175][25.7:132](),[25.1175][25.7:132]()
    end
    })
    if Search_term == nil then
    if line_index == Cursor1.line then
    Text.draw_cursor(Margin_left, y)
  • resurrect zombie in main.lua at line 255
    [25.394][25.306:342](),[25.394][25.306:342](),[25.342][25.7:132](),[25.1175][25.7:132](),[25.1175][25.7:132]()
    end
    })
    if Search_term == nil then
    if line_index == Cursor1.line then
    Text.draw_cursor(Margin_left, y)
  • edit in main.lua at line 262
    [25.1391][25.133:145]()
    end
  • resolve order conflict in main.lua at line 262
    [25.145]
    [25.1209]
  • edit in main.lua at line 291
    [25.512][25.282:333]()
    if App.getTime() - Last_resize_time < 0.1 then
  • edit in main.lua at line 295
    [25.621][25.343:510](),[25.510][10.238:271](),[10.271][25.557:706](),[25.557][25.557:706]()
    end
    end
    -- update Line_width with some hysteresis while the indicator is dragged
    if Line_width_hover then
    if App.getTime() - Line_width_hover > 0.1 then
    Line_width = App.mouse_x()
    Text.redraw_all()
    if App.mouse_down(1) then
    Line_width_hover = App.getTime()
    else
    Line_width_hover = nil
    end
  • edit in main.lua at line 310
    [25.24][25.334:444]()
    if Next_save and Next_save < App.getTime() then
    save_to_disk(Lines, Filename)
    Next_save = nil
    end
  • edit in main.lua at line 327
    [25.8][25.445:609](),[25.609][22.8:103]()
    function schedule_save()
    if Next_save == nil then
    Next_save = App.getTime() + 3 -- short enough that you're likely to still remember what you did
    end
    end
    -- make sure to save before quitting
    function love.quit()
    save_to_disk(Lines, Filename)
    end
  • resolve order conflict in main.lua at line 327
    [11.103]
    [25.1399]
  • edit in main.lua at line 336
    [25.2][25.707:877]()
    -- we seem to sometimes get phantom clicks if the mouse moves down into text while adjusting line-width
    if Line_width_hover then
    Selection1 = {}
    return
    end
  • resolve order conflict in main.lua at line 336
    [25.877]
    [25.304]
  • edit in main.lua at line 353
    [25.2422][25.738:769]()
    --? print('selection')
  • resolve order conflict in main.lua at line 353
    [13.769]
    [25.361]
  • edit in main.lua at line 370
    [25.365][25.610:630]()
    schedule_save()
  • resolve order conflict in main.lua at line 370
    [25.630]
    [25.208]
  • edit in main.lua at line 378
    [25.208][13.770:809]()
    --? print('reset selection')
  • edit in main.lua at line 412
    [25.649][13.810:867](),[25.354][25.631:649]()
    if not App.shift_down() then
    Selection1 = {}
    end
    schedule_save()
  • resolve order conflict in main.lua at line 412
    [25.649]
    [25.3116]
  • edit in main.lua at line 430
    [25.3421][25.1543:1599]()
    local byte_offset = Text.offset(Search_term, len)
  • resolve order conflict in main.lua at line 430
    [25.1599]
    [25.3477]
  • edit in main.lua at line 462
    [25.17776][25.650:672]()
    schedule_save()
  • edit in main.lua at line 474
    [25.17869][25.673:695]()
    schedule_save()
  • edit in main.lua at line 489
    [25.289][25.696:716]()
    schedule_save()
  • edit in main.lua at line 510
    [25.646][25.717:737]()
    schedule_save()
  • resolve order conflict in main.lua at line 510
    [25.737]
    [25.1877]
  • edit in main.lua at line 520
    [25.189][25.738:760]()
    schedule_save()
  • resolve order conflict in main.lua at line 520
    [25.760]
    [25.225]
  • edit in main.lua at line 545
    [25.782][25.1600:1655]()
    local byte_offset = Text.offset(p.name, len-1)
  • edit in main.lua at line 550
    [25.907][25.761:781]()
    schedule_save()
  • edit in main.lua at line 555
    [13.874][13.874:925](),[24.293][25.350:356](),[13.925][25.350:356](),[25.925][25.350:356](),[25.5055][25.350:356](),[25.350][25.350:356]()
    if not App.shift_down() then
    Selection1 = {}
    end
  • resolve order conflict in icons.lua at line 16
    [25.1345]
    [25.881]
  • edit in icons.lua at line 17
    [25.882][25.882:1345](),[25.1345][25.5334:5335](),[25.1345][25.5334:5335](),[25.5334][25.5334:5335]()
    function icon.line_width(x, y)
    love.graphics.setColor(0.7,0.7,0.7)
    love.graphics.line(x+0,y+0, x+9,y+0)
    love.graphics.line(x+0,y+1, x+9,y+1)
    love.graphics.line(x+0,y+2, x+9,y+2)
    love.graphics.line(x+0,y+3, x+9,y+3)
    love.graphics.line(x+0,y+4, x+9,y+4)
    love.graphics.line(x+0,y+5, x+9,y+5)
    love.graphics.line(x+1,y+6, x+8,y+6)
    love.graphics.line(x+2,y+7, x+7,y+7)
    love.graphics.line(x+3,y+8, x+6,y+8)
    love.graphics.line(x+4,y+9, x+5,y+9)
    end
  • edit in help.lua at line 5
    [25.6732][16.11:73]()
    love.graphics.print("Things you can do:", Margin_left+30,y)
  • resolve order conflict in help.lua at line 5
    [25.73]
    [25.4874]
  • edit in help.lua at line 6
    [25.4896][25.74:179]()
    love.graphics.print("* Press the mouse button to start drawing a "..current_shape(), Margin_left+30,y)
  • edit in help.lua at line 9
    [25.5014][16.180:296]()
    love.graphics.print("* Hover on a point and press 'ctrl+u' to pick it up and start moving it,", Margin_left+30,y)
  • resolve order conflict in help.lua at line 9
    [25.296]
    [25.5106]
  • edit in help.lua at line 11
    [25.5128][16.297:395]()
    love.graphics.print("then press the mouse button to drop it", Margin_left+30+bullet_indent(),y)
  • resolve order conflict in help.lua at line 11
    [25.395]
    [25.5322]
  • edit in help.lua at line 12
    [25.5344][25.396:510]()
    love.graphics.print("* Hover on a point and press 'ctrl+n', type a name, then press 'enter'", Margin_left+30,y)
  • edit in help.lua at line 15
    [25.5445][16.511:614]()
    love.graphics.print("* Hover on a point or shape and press 'ctrl+d' to delete it", Margin_left+30,y)
  • resolve order conflict in help.lua at line 15
    [25.614]
    [25.5539]
  • edit in help.lua at line 18
    [25.7341][16.615:715]()
    love.graphics.print("* Press 'ctrl+p' to switch to drawing freehand strokes", Margin_left+30,y)
  • resolve order conflict in help.lua at line 18
    [25.715]
    [25.5675]
  • edit in help.lua at line 22
    [25.7506][16.716:805]()
    love.graphics.print("* Press 'ctrl+l' to switch to drawing lines", Margin_left+30,y)
  • resolve order conflict in help.lua at line 22
    [5.100]
    [25.5780]
  • edit in help.lua at line 26
    [25.7665][16.806:915]()
    love.graphics.print("* Press 'ctrl+m' to switch to drawing horizontal/vertical lines", Margin_left+30,y)
  • resolve order conflict in help.lua at line 26
    [25.915]
    [25.5905]
  • edit in help.lua at line 29
    [25.7841][25.916:1012]()
    love.graphics.print("* Press 'ctrl+o' to switch to drawing circles/arcs", Margin_left+30,y)
  • edit in help.lua at line 34
    [25.8005][16.1013:1105]()
    love.graphics.print("* Press 'ctrl+g' to switch to drawing polygons", Margin_left+30,y)
  • resolve order conflict in help.lua at line 34
    [25.1119]
    [25.6125]
  • edit in help.lua at line 38
    [25.474][16.1106:1200]()
    love.graphics.print("* Press 'ctrl+r' to switch to drawing rectangles", Margin_left+30,y)
  • resolve order conflict in help.lua at line 38
    [25.1214]
    [25.6235]
  • edit in help.lua at line 41
    [25.635][16.1201:1292](),[25.635][16.1201:1292](),[25.8121][16.1293:1405](),[25.8121][16.1293:1405]()
    love.graphics.print("* Press 'ctrl+s' to switch to drawing squares", Margin_left+30,y)
    love.graphics.print("* Press 'ctrl+=' or 'ctrl+-' to zoom in or out, ctrl+0 to reset zoom", Margin_left+30,y)
  • resolve order conflict in help.lua at line 41
    [25.1327]
    [25.6557]
  • edit in help.lua at line 42
    [25.6579][25.1328:1408]()
    love.graphics.print("Press 'esc' now to hide this message", Margin_left+30,y)
  • edit in help.lua at line 45
    [25.8466][25.1409:1527]()
    love.graphics.rectangle('fill', Margin_left,drawing.y, Line_width, math.max(Drawing.pixels(drawing.h),y-drawing.y))
  • edit in help.lua at line 52
    [25.8689][16.1606:1709]()
    love.graphics.print("You're currently drawing a "..current_shape(drawing.pending), Margin_left+30,y)
  • resolve order conflict in help.lua at line 52
    [25.1631]
    [25.6765]
  • edit in help.lua at line 54
    [25.6787][16.1710:1776]()
    love.graphics.print('Things you can do now:', Margin_left+30,y)
  • resolve order conflict in help.lua at line 54
    [25.1698]
    [25.6844]
  • edit in help.lua at line 57
    [25.8935][16.1777:1878]()
    love.graphics.print('* Release the mouse button to finish drawing the stroke', Margin_left+30,y)
  • resolve order conflict in help.lua at line 57
    [25.1800]
    [25.6959]
  • edit in help.lua at line 60
    [25.9138][16.1879:1978]()
    love.graphics.print('* Release the mouse button to finish drawing the line', Margin_left+30,y)
  • resolve order conflict in help.lua at line 60
    [25.1900]
    [25.7074]
  • edit in help.lua at line 63
    [25.9347][25.1901:2004]()
    love.graphics.print('* Release the mouse button to finish drawing the circle', Margin_left+30,y)
  • edit in help.lua at line 66
    [25.7219][16.2083:2174]()
    love.graphics.print("* Press 'a' to draw just an arc of a circle", Margin_left+30,y)
  • resolve order conflict in help.lua at line 66
    [25.2096]
    [25.9561]
  • edit in help.lua at line 68
    [25.9570][16.2175:2275]()
    love.graphics.print('* Release the mouse button to finish drawing the arc', Margin_left+30,y)
  • resolve order conflict in help.lua at line 68
    [25.2197]
    [25.9670]
  • edit in help.lua at line 72
    [25.9744][16.2276:2378](),[25.9744][16.2276:2378](),[25.7536][16.2379:2467](),[25.7536][16.2379:2467]()
    love.graphics.print('* Release the mouse button to finish drawing the polygon', Margin_left+30,y)
    love.graphics.print("* Press 'p' to add a vertex to the polygon", Margin_left+30,y)
  • resolve order conflict in help.lua at line 72
    [25.2308]
    [25.7615]
  • edit in help.lua at line 83
    [25.7639][25.12:363](),[25.363][23.12:117](),[23.117][25.469:845](),[25.469][25.469:845](),[25.845][23.118:220](),[23.220][25.948:982](),[25.948][25.948:982]()
    elseif Current_drawing_mode == 'rectangle' then
    if #drawing.pending.vertices < 2 then
    love.graphics.print("* Press 'p' to add a vertex to the rectangle", Margin_left+30,y)
    y = y + Line_height
    else
    love.graphics.print('* Release the mouse button to finish drawing the rectangle', Margin_left+30,y)
    y = y + Line_height
    love.graphics.print("* Press 'p' to replace the second vertex of the rectangle", Margin_left+30,y)
    y = y + Line_height
    end
    elseif Current_drawing_mode == 'square' then
    if #drawing.pending.vertices < 2 then
    love.graphics.print("* Press 'p' to add a vertex to the square", Margin_left+30,y)
    y = y + Line_height
    else
    love.graphics.print('* Release the mouse button to finish drawing the square', Margin_left+30,y)
    y = y + Line_height
    love.graphics.print("* Press 'p' to replace the second vertex of the square", Margin_left+30,y)
    y = y + Line_height
    end
  • resolve order conflict in help.lua at line 83
    [12.502]
    [25.9970]
  • edit in help.lua at line 85
    [25.9976][16.2468:2583]()
    love.graphics.print("* Press 'esc' then release the mouse button to cancel the current shape", Margin_left+30,y)
  • resolve order conflict in help.lua at line 85
    [25.2424]
    [25.7746]
  • edit in help.lua at line 89
    [25.10164][16.2584:2668]()
    love.graphics.print("* Press 'l' to switch to drawing lines", Margin_left+30,y)
  • resolve order conflict in help.lua at line 89
    [5.185]
    [25.7866]
  • edit in help.lua at line 94
    [25.10318][25.2510:2614]()
    love.graphics.print("* Press 'm' to switch to drawing horizontal/vertical lines", Margin_left+30,y)
  • edit in help.lua at line 99
    [25.10489][16.2774:2865]()
    love.graphics.print("* Press 'o' to switch to drawing circles/arcs", Margin_left+30,y)
  • resolve order conflict in help.lua at line 99
    [25.2706]
    [25.8093]
  • edit in help.lua at line 101
    [25.10648][16.2866:2953](),[25.10648][16.2866:2953]()
    love.graphics.print("* Press 'g' to switch to drawing polygons", Margin_left+30,y)
  • edit in help.lua at line 102
    [25.797][25.2707:2796]()
    love.graphics.print("* Press 'r' to switch to drawing rectangles", Margin_left+30,y)
  • edit in help.lua at line 105
    [25.953][16.3044:3130](),[25.953][16.3044:3130]()
    love.graphics.print("* Press 's' to switch to drawing squares", Margin_left+30,y)
  • edit in help.lua at line 106
    [25.10798][25.2797:2915]()
    love.graphics.rectangle('fill', Margin_left,drawing.y, Line_width, math.max(Drawing.pixels(drawing.h),y-drawing.y))
  • edit in geom.lua at line 3
    [20.213][20.213:214](),[20.213][20.213:214]()
  • resolve order conflict in geom.lua at line 3
    [25.214]
    [25.11597]
  • edit in geom.lua at line 17
    [25.240][25.215:252]()
    return y >= y1-2 and y <= y2+2
  • edit in geom.lua at line 25
    [25.438][20.253:290]()
    return x >= x1-2 and x <= x2+2
  • resolve order conflict in geom.lua at line 25
    [25.290]
    [25.510]
  • edit in geom.lua at line 33
    [25.12094][25.291:407]()
    local dist = geom.dist(center.x,center.y, x,y)
    return dist > shape.radius*0.95 and dist < shape.radius*1.05
  • edit in geom.lua at line 73
    [25.13048][20.408:441]()
    if math.abs(p1.x-x) > 2 then
  • resolve order conflict in geom.lua at line 73
    [25.441]
    [25.13081]
  • edit in geom.lua at line 79
    [25.13184][25.442:477]()
    return y >= y1-2 and y <= y2+2
  • edit in geom.lua at line 84
    [25.13333][25.478:509]()
    if yp < y-2 or yp > y+2 then
  • edit in geom.lua at line 89
    [25.13451][25.510:544]()
    return k > -0.005 and k < 1.005
  • edit in drawing_tests.lua at line 13
    [25.327][25.789:979]()
    -- file not immediately saved
    App.update(0.01)
    check_nil(App.filesystem['foo'], 'F - test_creating_drawing_saves/early')
    -- wait until save
    App.wait_fake_time(3.1)
    App.update(0)
  • edit in drawing_tests.lua at line 50
    [25.1529][25.980:1043]()
    -- wait until save
    App.wait_fake_time(3.1)
    App.update(0)
  • edit in drawing_tests.lua at line 188
    [25.619][2.14:74]()
    check_eq(#drawing.points, 1, 'F - test_draw_arc/#points')
  • edit in drawing_tests.lua at line 339
    [25.1770][25.1044:1107]()
    -- wait until save
    App.wait_fake_time(3.1)
    App.update(0)
  • edit in drawing_tests.lua at line 369
    [25.1137][25.1108:1171](),[25.1137][25.1108:1171]()
    -- wait until save
    App.wait_fake_time(3.1)
    App.update(0)
  • resurrect zombie in drawing_tests.lua at line 369
    [25.1137][25.1108:1171](),[25.1137][25.1108:1171]()
    -- wait until save
    App.wait_fake_time(3.1)
    App.update(0)
  • edit in drawing_tests.lua at line 398
    [25.1938][25.1172:1235]()
    -- wait until save
    App.wait_fake_time(3.1)
    App.update(0)
  • resolve order conflict in drawing_tests.lua at line 398
    [25.1235]
    [25.471]
  • edit in drawing_tests.lua at line 403
    [25.680][25.14:19](),[25.1938][25.14:19](),[25.19][8.15:1248]()
    end
    function test_move_point_on_manhattan_line()
    io.write('\ntest_move_point_on_manhattan_line')
    -- create a drawing with a manhattan line
    Filename = 'foo'
    App.screen.init{width=Margin_left+300, height=300}
    Lines = load_array{'```lines', '```', ''}
    Line_width = 256 -- drawing coordinates 1:1 with pixels
    Current_drawing_mode = 'manhattan'
    App.draw()
    App.run_after_mouse_press(Margin_left+5, Margin_top+Drawing_padding_top+6, 1)
    App.run_after_mouse_release(Margin_left+35, Margin_top+Drawing_padding_top+46, 1)
    local drawing = Lines[1]
    check_eq(#drawing.shapes, 1, 'F - test_move_point_on_manhattan_line/baseline/#shapes')
    check_eq(#drawing.points, 2, 'F - test_move_point_on_manhattan_line/baseline/#points')
    check_eq(drawing.shapes[1].mode, 'manhattan', 'F - test_move_point_on_manhattan_line/baseline/shape:1')
    App.draw()
    -- enter 'move' mode
    App.run_after_keychord('C-u')
    check_eq(Current_drawing_mode, 'move', 'F - test_move_point_on_manhattan_line/mode:1')
    -- move point
    App.mouse_move(Margin_left+26, Margin_top+Drawing_padding_top+44)
    App.update(0.05)
    -- line is no longer manhattan
    check_eq(drawing.shapes[1].mode, 'line', 'F - test_move_point_on_manhattan_line/baseline/shape:1')
  • resolve order conflict in drawing_tests.lua at line 405
    [8.1253]
    [19.15]
  • edit in drawing_tests.lua at line 456
    [25.1304][25.1236:1302]()
    -- wait for some time
    App.wait_fake_time(3.1)
    App.update(0)
  • resolve order conflict in drawing_tests.lua at line 456
    [25.1302]
    [25.701]
  • edit in drawing_tests.lua at line 522
    [25.1995][25.1303:1366]()
    -- wait until save
    App.wait_fake_time(3.1)
    App.update(0)
  • edit in drawing_tests.lua at line 574
    [25.1992][25.1367:1430]()
    -- wait until save
    App.wait_fake_time(3.1)
    App.update(0)
  • resolve order conflict in drawing_tests.lua at line 574
    [25.1430]
    [25.34]
  • edit in drawing_tests.lua at line 613
    [25.1685][25.1431:1494]()
    -- wait until save
    App.wait_fake_time(3.1)
    App.update(0)
  • resolve order conflict in drawing_tests.lua at line 613
    [25.1494]
    [25.1685]
  • edit in drawing.lua at line 249
    [25.772][8.1255:1334]()
    Drawing.relax_constraints(drawing, drawing.pending.target_point_index)
  • edit in drawing.lua at line 257
    [25.1033][8.1335:1412]()
    Drawing.relax_constraints(drawing, drawing.pending.target_point_index)
  • edit in drawing.lua at line 261
    [25.300][25.1041:1052](),[25.4301][25.1041:1052](),[25.1041][25.1041:1052](),[25.1052][8.1413:1864]()
    end
    end
    function Drawing.relax_constraints(drawing, p)
    for _,shape in ipairs(drawing.shapes) do
    if shape.mode == 'manhattan' then
    if shape.p1 == p then
    shape.mode = 'line'
    elseif shape.p2 == p then
    shape.mode = 'line'
    end
    elseif shape.mode == 'rectangle' or shape.mode == 'square' then
    for _,v in ipairs(shape.vertices) do
    if v == p then
    shape.mode = 'polygon'
    end
    end
    end
  • resolve order conflict in drawing.lua at line 264
    [8.1875]
    [19.1413]
  • edit in drawing.lua at line 299
    [25.365][3.15:90]()
    drawing.pending.p2 = Drawing.insert_point(drawing.points, mx,my)
  • edit in drawing.lua at line 307
    [25.1191][3.91:171]()
    drawing.pending.p2 = Drawing.insert_point(drawing.points, mx, p1.y)
  • edit in drawing.lua at line 309
    [25.1322][3.172:252]()
    drawing.pending.p2 = Drawing.insert_point(drawing.points, p1.x, my)
  • edit in drawing.lua at line 386
    [4.4500][25.1398:1589](),[25.1398][25.1398:1589](),[25.5858][15.15:1398](),[25.5858][15.15:1398]()
    drawing.pending.p1 = drawing.pending.center
    end
    drawing.pending.mode = 'manhattan'
    elseif chord == 'C-m' and not App.mouse_down(1) then
    Current_drawing_mode = 'manhattan'
    elseif App.mouse_down(1) and chord == 'l' then
    Current_drawing_mode = 'line'
    local _,drawing = Drawing.current_drawing()
    if drawing.pending.mode == 'freehand' then
    drawing.pending.p1 = Drawing.insert_point(drawing.points, drawing.pending.points[1].x, drawing.pending.points[1].y)
    elseif drawing.pending.mode == 'polygon' or drawing.pending.mode == 'rectangle' or drawing.pending.mode == 'square' then
    drawing.pending.p1 = drawing.pending.vertices[1]
    elseif drawing.pending.mode == 'circle' or drawing.pending.mode == 'arc' then
    drawing.pending.p1 = drawing.pending.center
    end
    drawing.pending.mode = 'line'
    elseif chord == 'C-l' and not App.mouse_down(1) then
    Current_drawing_mode = 'line'
    elseif App.mouse_down(1) and chord == 'm' then
    Current_drawing_mode = 'manhattan'
    local drawing = Drawing.select_drawing_at_mouse()
    if drawing.pending.mode == 'freehand' then
    drawing.pending.p1 = Drawing.insert_point(drawing.points, drawing.pending.points[1].x, drawing.pending.points[1].y)
    elseif drawing.pending.mode == 'line' then
    -- do nothing
    elseif drawing.pending.mode == 'polygon' or drawing.pending.mode == 'rectangle' or drawing.pending.mode == 'square' then
    drawing.pending.p1 = drawing.pending.vertices[1]
    elseif drawing.pending.mode == 'circle' or drawing.pending.mode == 'arc' then
  • resurrect zombie in drawing.lua at line 386
    [15.1398][15.1398:1589](),[15.1398][15.1398:1589]()
    drawing.pending.p1 = drawing.pending.center
    end
    drawing.pending.mode = 'manhattan'
    elseif chord == 'C-m' and not App.mouse_down(1) then
    Current_drawing_mode = 'manhattan'
  • resolve order conflict in drawing.lua at line 386
    [4.4500]
    [15.1398]
  • edit in drawing.lua at line 391
    [25.6467][25.15:103](),[25.6467][25.15:103]()
    elseif drawing.pending.mode == 'rectangle' or drawing.pending.mode == 'square' then
  • edit in drawing.lua at line 403
    [25.7020][25.104:229](),[25.7020][25.104:229]()
    elseif drawing.pending.mode == 'polygon' or drawing.pending.mode == 'square' then
    -- reuse existing (1-2) vertices
  • resolve order conflict in drawing.lua at line 403
    [25.426]
    [25.7102]
  • edit in drawing.lua at line 406
    [25.380][25.230:461](),[25.380][25.230:461]()
    elseif drawing.pending.mode == 'rectangle' then
    -- reuse existing (1-2) vertices
    elseif drawing.pending.mode == 'circle' or drawing.pending.mode == 'arc' then
    drawing.pending.vertices = {drawing.pending.center}
  • edit in drawing.lua at line 486
    [25.2665][8.1876:1946]()
    local drawing_index,drawing,i,p = Drawing.select_point_at_mouse()
  • edit in drawing.lua at line 492
    [25.10259][8.1947:2037]()
    drawing.pending = {mode=Current_drawing_mode, target_point=p, target_point_index=i}
  • edit in app.lua at line 168
    [25.6426][25.1498:1618]()
    App.time = 1
    function App.getTime()
    return App.time
    end
    function App.wait_fake_time(t)
    App.time = App.time + t
    end
  • resolve order conflict in app.lua at line 168
    [25.1619]
    [25.6426]
  • edit in app.lua at line 346
    [25.2680][25.1619:1636]()
    App.time = nil
  • resolve order conflict in app.lua at line 346
    [25.1637]
    [25.7911]
  • edit in app.lua at line 350
    [25.2236][25.1638:1742]()
    App.run_after_mouse_click = nil
    App.run_after_mouse_press = nil
    App.run_after_mouse_release = nil
  • edit in app.lua at line 366
    [25.2791][25.1743:1778]()
    App.getTime = love.timer.getTime
  • edit in README.md at line 79
    [25.884][18.18:91]()
    * `alt+right`/`alt+left` to jump to the next/previous word, respectively
  • resolve order conflict in README.md at line 79
    [7.93]
    [25.884]
  • edit in README.md at line 112
    [25.21][25.18:135](),[25.21][25.18:135]()
    * No clipping yet for drawings. In particular, circles/squares/rectangles and
    point labels can overflow a drawing.
  • resolve order conflict in README.md at line 112
    [25.137]
    [25.203]
  • edit in README.md at line 129
    [25.1609][17.18:197](),[25.1609][17.18:197]()
    * https://github.com/akkartik/lines-polygon-experiment -- an experiment that
    uses separate shortcuts for regular polygons. `ctrl+3` for triangles,
    `ctrl+4` for squares, etc.
  • resolve order conflict in README.md at line 129
    [6.269]
    [25.1609]
  • edit in Manual_tests.md at line 11
    [25.379][14.24:190]()
    byte offsets with the suffix `_offset`, and character positions as `_pos`.
    For example, `string.sub` should never use a `_pos` to substring, only an
    `_offset`.