fork: capture frontend for a note-taking system

[?]
Jul 6, 2022, 4:56 AM
ZLEPKWDJAKYNSLOAI3IS3H4SERERCZZJ5ZSDIYFCU6Y7J3F4FSXAC

Dependencies

  • [2] JZKEIKO6 freudian typo
  • [3] E5FYDACS a likely source of issues
  • [4] VO3GEIRW use app name in window title
  • [5] F4QQIBEH clarify what "large files" means
  • [6] YT5P6TO6 bugfix: save previous file when dropping a new one on
  • [7] KQWIMWJ5 deemphasize the terminal in Readme
  • [8] SBS2F7GR link to export tool
  • [9] G5HANZBI bugfix
  • [10] IDGP4BJZ new known issue with drawings
  • [11] Z4KNS42N to open a file without a terminal, drag it on!
  • [12] A2QPFRFJ move
  • [13] PGZJ6NAT ensure Filename is writable when opened outside a terminal
  • [14] JCSLDGAH beginnings of support for multiple shapes
  • [15] 25V2GA6J taking stock
  • [16] AJB4LFRB try to maintain a reasonable line width
  • [17] BZRRUIFQ correct location of the line width slider
  • [18] PWHZPJJM always show current filename in window title
  • [19] HOSPP2AN crisp font rendering
  • [20] OYXDYPGS get rid of debug variables
  • [21] OTIBCAUJ love2d scaffold
  • [22] LUNH47XX make text and drawings the same width
  • [23] ESETRNLB bugfix: printing the first part of a line at the bottom made it seem non-wrapping
  • [24] M6JI7UJ7 obsolete comment
  • [25] 2C7CTIQY make space for multiple kinds of width
  • [26] SVJZZDC3 snapshot - no, that's all wrong
  • [27] MGOQ5XAV start uppercasing globals
  • [28] PX7DDEMO autosave slightly less aggressively
  • [29] QCQHLMST always have a filename
  • [30] O6T3TPXD bugfix: position cursor up top when loading file
  • [31] R6GUSTBY default font size and line-height
  • [32] 2FBLO5FH adjust window size
  • [33] WQOSZSUE warn on unused commandline args
  • [34] 5T2E3PDV couple of bugfixes to file-handling
  • [35] NEXUNNCF extract a function
  • [36] XSLCFVFH .
  • [37] AD34IX2Z couple more tests
  • [38] W4UVZETR 2 regressions:
  • [39] ICIIP4DB slightly better default sizing of drawings
  • [40] VHQCNMAR several more modules
  • [41] 2RXZ3PGO beginning of a new approach to scroll+wrap
  • [42] IEHG6ORO new fork for #1
  • [43] BPWFKBXT new test: dragging and dropping a file on lines.love
  • [44] WAQFRM2U fix contact link
  • [45] IZZVOCLB confirm that we have access to all of the love API
  • [46] YKRF5V3Z starting to load/save
  • [47] FS2ITYYH record a known issue
  • [48] MHOUX5JF experiment: turn off JIT
  • [49] AVQ5MC5D finish uppercasing all globals
  • [50] ZNLTRNNK highlight another global
  • [51] MLG2OGU7 things seem to feel snappier now
  • [52] YIQYNVD2 rip out the line-width slider
  • [53] V5TP27FP ctrl-+ and ctrl-- to adjust font size
  • [54] ZTMRQZSW Readme
  • [55] D4FEFHQC flesh out Readme
  • [56] 73OCE2MC after much struggle, a brute-force undo
  • [57] ZZ2B5RPQ extract variables for drawing padding
  • [58] CE4LZV4T drop last couple of manual tests
  • [59] AVTNUQYR basic test-enabled framework
  • [60] M36DBSDE bit more polish to help screen
  • [61] BJ5X5O4A let's prevent the text cursor from ever getting on a drawing
  • [62] KJKKASHZ reduce ambitions a bit: page up/down need not start screen from the middle of a line
  • [63] 2KRK3OBV don't rely on defaults
  • [64] YGCT2D2O start loading settings as applicable
  • [65] CZRMAMSB clearer discription of how to run lines.love
  • [66] LAW2O3NW extract variable Margin_left
  • [67] YPHKZVWM extract a new variable
  • [68] 34TC5SYK record another known issue I don't know how to fix yet
  • [69] UYRAO73Y enable pressing and holding backspace

Change contents

  • edit in main_tests.lua at line 12
    [10.551][10.551:552](),[10.552][10.7:871](),[10.871][6.7:1001](),[10.1120][10.1120:1124]()
    function test_drop_file()
    io.write('\ntest_drop_file')
    App.screen.init{width=Margin_left+300, height=300}
    App.filesystem['foo'] = 'abc\ndef\nghi\n'
    local fake_dropped_file = {
    opened = false,
    getFilename = function(self)
    return 'foo'
    end,
    open = function(self)
    self.opened = true
    end,
    lines = function(self)
    assert(self.opened)
    return App.filesystem['foo']:gmatch('[^\n]+')
    end,
    close = function(self)
    self.opened = false
    end,
    }
    App.filedropped(fake_dropped_file)
    check_eq(#Lines, 3, 'F - test_drop_file/#lines')
    check_eq(Lines[1].data, 'abc', 'F - test_drop_file/lines:1')
    check_eq(Lines[2].data, 'def', 'F - test_drop_file/lines:2')
    check_eq(Lines[3].data, 'ghi', 'F - test_drop_file/lines:3')
    end
    function test_drop_file_saves_previous()
    io.write('\ntest_drop_file_saves_previous')
    App.screen.init{width=Margin_left+300, height=300}
    -- initially editing a file called foo that hasn't been saved to filesystem yet
    Lines = load_array{'abc', 'def'}
    Filename = 'foo'
    schedule_save()
    -- now drag a new file bar from the filesystem
    App.filesystem['bar'] = 'abc\ndef\nghi\n'
    local fake_dropped_file = {
    opened = false,
    getFilename = function(self)
    return 'bar'
    end,
    open = function(self)
    self.opened = true
    end,
    lines = function(self)
    assert(self.opened)
    return App.filesystem['bar']:gmatch('[^\n]+')
    end,
    close = function(self)
    self.opened = false
    end,
    }
    App.filedropped(fake_dropped_file)
    -- filesystem now contains a file called foo
    check_eq(App.filesystem['foo'], 'abc\ndef\n', 'F - test_drop_file_saves_previous')
    end
  • replacement in main.lua at line 86
    [10.4][10.3:63]()
    Filename = love.filesystem.getUserDirectory()..'/lines.txt'
    [10.4]
    [10.137]
    Directory = love.filesystem.getUserDirectory()..'/pensieve'
    Filename = love.filesystem.getUserDirectory()..'/lines.txt' -- just for tests
  • replacement in main.lua at line 119
    [10.33][10.44:63](),[10.38][10.44:63](),[10.75][10.44:63](),[10.63][10.609:631](),[10.631][10.149:420](),[10.420][9.8:80](),[9.80][10.467:605](),[10.467][10.467:605](),[10.15][10.452:466](),[10.605][10.452:466](),[10.690][10.452:466](),[10.452][10.452:466](),[10.466][4.8:58]()
    if #arg > 0 then
    Filename = arg[1]
    Lines = load_from_disk(Filename)
    Screen_top1 = {line=1, pos=1}
    Cursor1 = {line=1, pos=1}
    for i,line in ipairs(Lines) do
    if line.mode == 'text' then
    Cursor1.line = i
    break
    end
    end
    else
    Lines = load_from_disk(Filename)
    if Cursor1.line > #Lines or Lines[Cursor1.line].mode ~= 'text' then
    for i,line in ipairs(Lines) do
    if line.mode == 'text' then
    Cursor1.line = i
    break
    end
    end
    end
    end
    love.window.setTitle('lines.love - '..Filename)
    [10.127]
    [10.8]
    assert(#arg == 0)
    Filename = Directory..os.date('/%Y/%m/%d/%H-%M-%S')
    os.execute('mkdir -p '..dirname(Filename))
    assert(not file_exists(Filename))
  • replacement in main.lua at line 124
    [10.9][10.9:88]()
    if #arg > 1 then
    print('ignoring commandline args after '..arg[1])
    end
    [10.9]
    [10.8]
    love.window.setTitle('capture.love - '..Filename)
  • edit in main.lua at line 186
    [10.7][10.1321:1352](),[10.1352][6.1003:1157](),[6.1157][10.8165:8235](),[10.1352][10.8165:8235](),[10.1352][10.747:779](),[10.8235][10.747:779](),[10.39][10.747:779](),[10.779][10.71:88](),[10.71][10.71:88](),[10.88][10.146:177](),[10.177][10.1:16](),[10.119][10.1:16](),[10.16][10.178:211](),[10.211][10.500:532](),[10.500][10.500:532](),[10.532][10.9223:9246](),[10.9246][10.16:28](),[10.802][10.16:28](),[10.28][10.554:568](),[10.802][10.554:568](),[10.554][10.554:568](),[10.568][10.803:858](),[10.16][10.183:188](),[10.70][10.183:188](),[10.75][10.183:188](),[10.119][10.183:188](),[10.155][10.183:188](),[10.163][10.183:188](),[10.858][10.183:188](),[10.183][10.183:188]()
    function App.filedropped(file)
    -- first make sure to save edits on any existing file
    if Next_save then
    save_to_disk(Lines, Filename)
    end
    -- clear the slate for the new file
    App.initialize_globals() -- in particular, forget all undo history
    Filename = file:getFilename()
    file:open('r')
    Lines = load_from_file(file)
    file:close()
    for i,line in ipairs(Lines) do
    if line.mode == 'text' then
    Cursor1.line = i
    break
    end
    end
    love.window.setTitle('Text with Lines - '..Filename)
    end
  • edit in file.lua at line 3
    [10.15167]
    [10.15167]
    function file_exists(filename)
    local infile = App.open_for_reading(filename)
    if infile then
    infile:close()
    return true
    else
    return false
    end
    end
  • edit in file.lua at line 186
    [10.18211]
    function dirname(path)
    return string.gsub(path, "(.*)/.*", "%1")
    end
    function basename(path)
    return string.gsub(path, ".*/(.*)", "%1")
    end
  • replacement in README.md at line 1
    [10.6][10.14:38]()
    # Plain text with lines
    [10.6]
    [10.18]
    # capture.love
    Sometimes you just want to capture a stray thought. Seeing unrelated text can
    make it fly right out of your brain. This app gives you a blank slate every
    time, and captures your thought to a single hard-coded directory tree. Other
    apps can take it from there and help you browse that directory tree.
  • replacement in README.md at line 8
    [10.19][10.19:96]()
    An editor for plain text where you can also seamlessly insert line drawings.
    [10.19]
    [10.96]
    capture.love is a compatible fork of [lines.love](http://akkartik.name/lines.html),
    an editor for plain text where you can also seamlessly insert line drawings.
  • edit in README.md at line 12
    [10.202][10.38:71](),[10.38][10.38:71]()
    http://akkartik.name/lines.html
  • edit in README.md at line 14
    [10.162][10.162:163](),[10.163][7.19:58]()
    To run lines.love, double-click on it.
  • replacement in README.md at line 15
    [10.223][10.223:378]()
    By default, lines.love reads/writes the file `lines.txt` in your default
    user/home directory (`https://love2d.org/wiki/love.filesystem.getUserDirectory`).
    [10.223]
    [10.378]
    To run capture.love, double-click on it. It can also be [invoked from the
    terminal](https://love2d.org/wiki/Getting_Started#Running_Games).
  • replacement in README.md at line 18
    [10.379][7.59:119](),[7.119][10.504:505](),[10.573][10.504:505](),[10.504][10.504:505](),[10.505][7.120:264]()
    To open a different file, drop it on the lines.love window.
    lines.love can also be [invoked from the terminal](https://love2d.org/wiki/Getting_Started#Running_Games),
    optionally with a file path to edit.
    [10.379]
    [10.629]
    Side-effects: it writes to a unique file in the `pensieve` directory in your
    default user/home directory (`https://love2d.org/wiki/love.filesystem.getUserDirectory`).
  • replacement in README.md at line 35
    [3.19][3.19:95]()
    lines.love has been exclusively tested so far with a US keyboard layout. If
    [3.19]
    [3.95]
    capture.love has been exclusively tested so far with a US keyboard layout. If
  • replacement in README.md at line 44
    [10.95][5.19:93]()
    other ways. lines.love works well in all circumstances with files under
    [10.95]
    [5.93]
    other ways. capture.love works well in all circumstances with files under
  • replacement in README.md at line 74
    [10.1142][10.1142:1528]()
    Updates to lines.love can be downloaded from the following mirrors in addition
    to the website above:
    * https://github.com/akkartik/lines.love
    * https://repo.or.cz/lines.love.git
    * https://codeberg.org/akkartik/lines.love
    * https://tildegit.org/akkartik/lines.love
    * https://git.tilde.institute/akkartik/lines.love
    * https://git.sr.ht/~akkartik/lines.love
    * https://pagure.io/lines.love
    [10.1142]
    [10.1528]
    This repo is a fork of lines.love at http://akkartik.name/lines.html.
    Updates to it can be downloaded from one of the following mirrors:
  • replacement in README.md at line 77
    [10.1529][2.18:96](),[2.96][10.1603:1609](),[10.1603][10.1603:1609]()
    Forks of lines.love are encouraged. If you show me your fork, I'll link to it
    here.
    [10.1529]
    [10.18]
    * https://github.com/akkartik/capture.love
    * https://repo.or.cz/capture.love.git
    * https://codeberg.org/akkartik/capture.love
    * https://tildegit.org/akkartik/capture.love
    * https://git.tilde.institute/akkartik/capture.love
    * https://git.sr.ht/~akkartik/capture.love
    * https://pagure.io/capture.love
  • replacement in README.md at line 85
    [10.19][10.19: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.
    [10.19]
    [8.19]
    Further forks are encouraged. If you show me your fork, I'll link to it here.