fork: capture frontend for a note-taking system
[?]
Jul 6, 2022, 4:56 AM
ZLEPKWDJAKYNSLOAI3IS3H4SERERCZZJ5ZSDIYFCU6Y7J3F4FSXACDependencies
- [2]
JZKEIKO6freudian typo - [3]
E5FYDACSa likely source of issues - [4]
VO3GEIRWuse app name in window title - [5]
F4QQIBEHclarify what "large files" means - [6]
YT5P6TO6bugfix: save previous file when dropping a new one on - [7]
KQWIMWJ5deemphasize the terminal in Readme - [8]
SBS2F7GRlink to export tool - [9]
G5HANZBIbugfix - [10]
IDGP4BJZnew known issue with drawings - [11]
Z4KNS42Nto open a file without a terminal, drag it on! - [12]
A2QPFRFJmove - [13]
PGZJ6NATensure Filename is writable when opened outside a terminal - [14]
JCSLDGAHbeginnings of support for multiple shapes - [15]
25V2GA6Jtaking stock - [16]
AJB4LFRBtry to maintain a reasonable line width - [17]
BZRRUIFQcorrect location of the line width slider - [18]
PWHZPJJMalways show current filename in window title - [19]
HOSPP2ANcrisp font rendering - [20]
OYXDYPGSget rid of debug variables - [21]
OTIBCAUJlove2d scaffold - [22]
LUNH47XXmake text and drawings the same width - [23]
ESETRNLBbugfix: printing the first part of a line at the bottom made it seem non-wrapping - [24]
M6JI7UJ7obsolete comment - [25]
2C7CTIQYmake space for multiple kinds of width - [26]
SVJZZDC3snapshot - no, that's all wrong - [27]
MGOQ5XAVstart uppercasing globals - [28]
PX7DDEMOautosave slightly less aggressively - [29]
QCQHLMSTalways have a filename - [30]
O6T3TPXDbugfix: position cursor up top when loading file - [31]
R6GUSTBYdefault font size and line-height - [32]
2FBLO5FHadjust window size - [33]
WQOSZSUEwarn on unused commandline args - [34]
5T2E3PDVcouple of bugfixes to file-handling - [35]
NEXUNNCFextract a function - [36]
XSLCFVFH. - [37]
AD34IX2Zcouple more tests - [38]
W4UVZETR2 regressions: - [39]
ICIIP4DBslightly better default sizing of drawings - [40]
VHQCNMARseveral more modules - [41]
2RXZ3PGObeginning of a new approach to scroll+wrap - [42]
IEHG6OROnew fork for #1 - [43]
BPWFKBXTnew test: dragging and dropping a file on lines.love - [44]
WAQFRM2Ufix contact link - [45]
IZZVOCLBconfirm that we have access to all of the love API - [46]
YKRF5V3Zstarting to load/save - [47]
FS2ITYYHrecord a known issue - [48]
MHOUX5JFexperiment: turn off JIT - [49]
AVQ5MC5Dfinish uppercasing all globals - [50]
ZNLTRNNKhighlight another global - [51]
MLG2OGU7things seem to feel snappier now - [52]
YIQYNVD2rip out the line-width slider - [53]
V5TP27FPctrl-+ and ctrl-- to adjust font size - [54]
ZTMRQZSWReadme - [55]
D4FEFHQCflesh out Readme - [56]
73OCE2MCafter much struggle, a brute-force undo - [57]
ZZ2B5RPQextract variables for drawing padding - [58]
CE4LZV4Tdrop last couple of manual tests - [59]
AVTNUQYRbasic test-enabled framework - [60]
M36DBSDEbit more polish to help screen - [61]
BJ5X5O4Alet's prevent the text cursor from ever getting on a drawing - [62]
KJKKASHZreduce ambitions a bit: page up/down need not start screen from the middle of a line - [63]
2KRK3OBVdon't rely on defaults - [64]
YGCT2D2Ostart loading settings as applicable - [65]
CZRMAMSBclearer discription of how to run lines.love - [66]
LAW2O3NWextract variable Margin_left - [67]
YPHKZVWMextract a new variable - [68]
34TC5SYKrecord another known issue I don't know how to fix yet - [69]
UYRAO73Yenable 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 = trueend,lines = function(self)assert(self.opened)return App.filesystem['foo']:gmatch('[^\n]+')end,close = function(self)self.opened = falseend,}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')endfunction 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 yetLines = load_array{'abc', 'def'}Filename = 'foo'schedule_save()-- now drag a new file bar from the filesystemApp.filesystem['bar'] = 'abc\ndef\nghi\n'local fake_dropped_file = {opened = false,getFilename = function(self)return 'bar'end,open = function(self)self.opened = trueend,lines = function(self)assert(self.opened)return App.filesystem['bar']:gmatch('[^\n]+')end,close = function(self)self.opened = falseend,}App.filedropped(fake_dropped_file)-- filesystem now contains a file called foocheck_eq(App.filesystem['foo'], 'abc\ndef\n', 'F - test_drop_file_saves_previous')end - replacement in main.lua at line 86
Filename = love.filesystem.getUserDirectory()..'/lines.txt'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 thenFilename = arg[1]Lines = load_from_disk(Filename)Screen_top1 = {line=1, pos=1}Cursor1 = {line=1, pos=1}for i,line in ipairs(Lines) doif line.mode == 'text' thenCursor1.line = ibreakendendelseLines = load_from_disk(Filename)if Cursor1.line > #Lines or Lines[Cursor1.line].mode ~= 'text' thenfor i,line in ipairs(Lines) doif line.mode == 'text' thenCursor1.line = ibreakendendendendlove.window.setTitle('lines.love - '..Filename)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
if #arg > 1 thenprint('ignoring commandline args after '..arg[1])endlove.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 fileif Next_save thensave_to_disk(Lines, Filename)end-- clear the slate for the new fileApp.initialize_globals() -- in particular, forget all undo historyFilename = file:getFilename()file:open('r')Lines = load_from_file(file)file:close()for i,line in ipairs(Lines) doif line.mode == 'text' thenCursor1.line = ibreakendendlove.window.setTitle('Text with Lines - '..Filename)end - edit in file.lua at line 3
function file_exists(filename)local infile = App.open_for_reading(filename)if infile theninfile:close()return trueelsereturn falseendend - edit in file.lua at line 186[10.18211]
function dirname(path)return string.gsub(path, "(.*)/.*", "%1")endfunction basename(path)return string.gsub(path, ".*/(.*)", "%1")end - replacement in README.md at line 1
# Plain text with lines# capture.loveSometimes you just want to capture a stray thought. Seeing unrelated text canmake it fly right out of your brain. This app gives you a blank slate everytime, and captures your thought to a single hard-coded directory tree. Otherapps can take it from there and help you browse that directory tree. - replacement in README.md at line 8
An editor for plain text where you can also seamlessly insert line drawings.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
http://akkartik.name/lines.html - edit in README.md at line 14
To run lines.love, double-click on it. - replacement in README.md at line 15
By default, lines.love reads/writes the file `lines.txt` in your defaultuser/home directory (`https://love2d.org/wiki/love.filesystem.getUserDirectory`).To run capture.love, double-click on it. It can also be [invoked from theterminal](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.Side-effects: it writes to a unique file in the `pensieve` directory in yourdefault user/home directory (`https://love2d.org/wiki/love.filesystem.getUserDirectory`). - replacement in README.md at line 35
lines.love has been exclusively tested so far with a US keyboard layout. Ifcapture.love has been exclusively tested so far with a US keyboard layout. If - replacement in README.md at line 44
other ways. lines.love works well in all circumstances with files underother ways. capture.love works well in all circumstances with files under - replacement in README.md at line 74
Updates to lines.love can be downloaded from the following mirrors in additionto 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.loveThis 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
Forks of lines.love are encouraged. If you show me your fork, I'll link to ithere.* 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
* https://github.com/akkartik/lines-polygon-experiment -- an experiment thatuses separate shortcuts for regular polygons. `ctrl+3` for triangles,`ctrl+4` for squares, etc.Further forks are encouraged. If you show me your fork, I'll link to it here.