Merge lines.love
[?]
Sep 3, 2022, 10:27 PM
57OGXVHZ44WNWVKNCMPJT7SAOF4MR4GXJ4ZQKHUFAKLZBB6ERDLACDependencies
- [2]
VEGH5443Merge upstream into main - [3]
NYMFNQDTMerge upstream into main - [4]
EUBREN3IMerge upstream into main - [5]
KKMFQDR4editing source code from within the app - [6]
YGCT2D2Ostart loading settings as applicable - [7]
3WNNXA6Ubugfix: get tests to pass - [8]
BJ5X5O4Alet's prevent the text cursor from ever getting on a drawing - [9]
2L5MEZV3experiment: new edit namespace - [10]
5MR22SGZbugfix: enable resize when loading settings - [11]
VSBSWTE4bugfix: where cursor is drawn - [12]
66X36NZNa little more prose describing manual_tests - [13]
LF7BWEG4group all editor globals - [14]
OAHNWDYG. - [15]
HPVT467Winitialize contains test state - [16]
G3VLJLDHuse the background color - [17]
M6JI7UJ7obsolete comment - [18]
LNUHQOGHstart passing in Editor_state explicitly - [19]
XX7G2FFJintermingle freehand line drawings with text - [20]
R6GUSTBYdefault font size and line-height - [21]
NEXUNNCFextract a function - [22]
MHOUX5JFexperiment: turn off JIT - [23]
TXDMRA5Jbugfix: alt-tab shouldn't emit keypress events - [24]
RT6EV6OPdelegate update events to drawings - [25]
KVHUFUFVreorg - [26]
UHB4GARJleft/right margin -> left/right coordinates - [27]
Z4KNS42Nto open a file without a terminal, drag it on! - [28]
UVIDOW6ZMerge upstream into main - [29]
ZLEPKWDJfork: capture frontend for a note-taking system - [30]
OTIBCAUJlove2d scaffold - [31]
JIK7ZRYIbugfix: imprecision in drawing - [32]
AVTNUQYRbasic test-enabled framework - [33]
4VKEE43Zbugfix - [34]
OOL2X3B7Merge upstream into main - [35]
CV6XLZMWtrailing slash on directory - [36]
XNHZZH6Bupdate /recent file with new filenames - [37]
CNCYMM6Amake test initializations a little more obvious - [38]
K464QQR4more defensive resize handling - [39]
ELIVOJ4Nbugfix: zoom in/out hotkeys - [40]
PX7DDEMOautosave slightly less aggressively - [41]
VO3GEIRWuse app name in window title - [42]
WQOSZSUEwarn on unused commandline args - [43]
S7ZZA3YEugh, handle absolute as well as relative paths - [44]
3QQZ7W4Ebring couple more globals back to the app level - [45]
XSLCFVFH. - [46]
JRLBUB6Lmore intuitive point delete from polygons - [47]
SPNMXTYRhave file API operate on state object - [48]
HRWN5V6JDevine's suggestion to try to live with just freehand - [49]
AJB4LFRBtry to maintain a reasonable line width - [50]
MSDHRXWUMerge upstream into main - [51]
JCSLDGAHbeginnings of support for multiple shapes - [52]
YT5P6TO6bugfix: save previous file when dropping a new one on - [53]
5XQ4Y7NUreorg manual tests doc - [54]
7M7LS7I2start saving some settings to disk on quit - [55]
AVQ5MC5Dfinish uppercasing all globals - [*]
2Y7YH7UPinfrastructure for caching LÖVE text objects
Change contents
- replacement in run.lua at line 29
if #arg > 0 thenEditor_state.filename = arg[1]load_from_disk(Editor_state)Text.redraw_all(Editor_state)Editor_state.screen_top1 = {line=1, pos=1}Editor_state.cursor1 = {line=1, pos=1}edit.fixup_cursor(Editor_state)elseload_from_disk(Editor_state)Text.redraw_all(Editor_state)if Editor_state.cursor1.line > #Editor_state.lines or Editor_state.lines[Editor_state.cursor1.line].mode ~= 'text' thenedit.fixup_cursor(Editor_state)endendlove.window.setTitle('lines.love - '..Editor_state.filename)assert(#arg == 0)Editor_state.file_path = os.date('%Y/%m/%d/%H-%M-%S')Editor_state.filename = Editor_state.directory..Editor_state.file_pathText.redraw_all(Editor_state)os.execute('mkdir -p '..dirname(Editor_state.filename))assert(not file_exists(Editor_state.filename)) - replacement in run.lua at line 36
if #arg > 1 thenprint('ignoring commandline args after '..arg[1])endlove.window.setTitle('capture.love - '..Editor_state.filename) - edit in run.lua at line 56
Editor_state.filename = Settings.filenameEditor_state.screen_top1 = Settings.screen_topEditor_state.cursor1 = Settings.cursor - edit in run.lua at line 93
function run.filedropped(file)-- first make sure to save edits on any existing fileif Editor_state.next_save thensave_to_disk(Editor_state)end-- clear the slate for the new fileApp.initialize_globals()Editor_state.filename = file:getFilename()file:open('r')Editor_state.lines = load_from_file(file)file:close()Text.redraw_all(Editor_state)edit.fixup_cursor(Editor_state)love.window.setTitle('lines.love - '..Editor_state.filename)end - edit in run.lua at line 108
local filename = Editor_state.filenameif filename:sub(1,1) ~= '/' thenfilename = love.filesystem.getWorkingDirectory()..'/'..filename -- '/' should work even on Windowsend - edit in run.lua at line 112
filename=filename,screen_top=Editor_state.screen_top1, cursor=Editor_state.cursor1 - replacement in main.lua at line 34[6.127]→[6.148:168](∅→∅),[6.168]→[6.8:137](∅→∅),[6.87]→[6.8:40](∅→∅),[6.137]→[6.8:40](∅→∅),[6.90]→[6.8:40](∅→∅),[6.40]→[6.90:197](∅→∅),[6.90]→[6.90:197](∅→∅)
assert(#arg == 0)Editor_state.file_path = os.date('%Y/%m/%d/%H-%M-%S')Editor_state.filename = Editor_state.directory..Editor_state.file_pathText.redraw_all(Editor_state)os.execute('mkdir -p '..dirname(Editor_state.filename))assert(not file_exists(Editor_state.filename))if Current_app == nil thenCurrent_app = 'run'end - edit in main.lua at line 38
love.window.setTitle('capture.love - '..Editor_state.filename) - resurrect zombie in main.lua at line 38[6.9]→[5.185083:186724](∅→∅),[6.9]→[5.185083:186724](∅→∅),[6.88]→[5.186725:186729](∅→∅),[6.88]→[5.186725:186729](∅→∅)
if Current_app == 'run' thenload_file_from_source_or_save_directory('file.lua')load_file_from_source_or_save_directory('run.lua')load_file_from_source_or_save_directory('edit.lua')load_file_from_source_or_save_directory('text.lua')load_file_from_source_or_save_directory('search.lua')load_file_from_source_or_save_directory('select.lua')load_file_from_source_or_save_directory('undo.lua')load_file_from_source_or_save_directory('icons.lua')load_file_from_source_or_save_directory('text_tests.lua')load_file_from_source_or_save_directory('run_tests.lua')load_file_from_source_or_save_directory('drawing.lua')load_file_from_source_or_save_directory('geom.lua')load_file_from_source_or_save_directory('help.lua')load_file_from_source_or_save_directory('drawing_tests.lua')elseload_file_from_source_or_save_directory('source_file.lua')load_file_from_source_or_save_directory('source.lua')load_file_from_source_or_save_directory('commands.lua')load_file_from_source_or_save_directory('source_edit.lua')load_file_from_source_or_save_directory('log_browser.lua')load_file_from_source_or_save_directory('source_text.lua')load_file_from_source_or_save_directory('search.lua')load_file_from_source_or_save_directory('select.lua')load_file_from_source_or_save_directory('source_undo.lua')load_file_from_source_or_save_directory('colorize.lua')load_file_from_source_or_save_directory('source_text_tests.lua')load_file_from_source_or_save_directory('source_tests.lua')end - edit in main.lua at line 66
end - edit in main.lua at line 78
Editor_state = edit.initialize_state(Margin_top, Margin_left, App.screen.width-Margin_right, settings.font_height, math.floor(settings.font_height*1.3)) - replacement in main.lua at line 91
love.window.setTitle('text.love - '..Current_app)love.window.setTitle('capture.love - '..Current_app) - replacement in main.lua at line 113
love.window.setTitle('text.love - '..Current_app)love.window.setTitle('capture.love - '..Current_app) - edit in main.lua at line 116
function App.focus(in_focus)if in_focus thenLast_focus_time = App.getTime()endif Current_app == 'run' thenif run.focus then run.focus(in_focus) endelseif Current_app == 'source' thenif source.focus then source.focus(in_focus) endelseassert(false, 'unknown app "'..Current_app..'"')endend - edit in main.lua at line 154
} - resurrect zombie in main.lua at line 154[6.8]→[5.188673:189596](∅→∅),[6.8]→[5.188673:189596](∅→∅),[6.181]→[5.189597:189872](∅→∅),[6.181]→[5.189597:189872](∅→∅)
function App.keychord_pressed(chord, key)-- ignore events for some time after window in focus (mostly alt-tab)if App.getTime() < Last_focus_time + 0.01 thenreturnend--if chord == 'C-e' then-- carefully save settingsif Current_app == 'run' thenlocal source_settings = Settings.sourceSettings = run.settings()Settings.source = source_settingsif run.quit then run.quit() endCurrent_app = 'source'elseif Current_app == 'source' thenSettings.source = source.settings()if source.quit then source.quit() endCurrent_app = 'run'elseassert(false, 'unknown app "'..Current_app..'"')endSettings.current_app = Current_applove.filesystem.write('config', json.encode(Settings))-- rebootload_file_from_source_or_save_directory('main.lua')App.undo_initialize()App.run_tests_and_initialize()returnif Current_app == 'run' thenif run.keychord_pressed then run.keychord_pressed(chord, key) endelseif Current_app == 'source' thenif source.keychord_pressed then source.keychord_pressed(chord, key) endelseassert(false, 'unknown app "'..Current_app..'"') - edit in main.lua at line 182
end - edit in main.lua at line 261[6.7]→[5.188003:188087](∅→∅),[6.7]→[5.188003:188087](∅→∅),[6.1119]→[5.188088:188321](∅→∅),[6.1119]→[5.188088:188321](∅→∅),[6.127]→[5.185029:185082](∅→∅),[6.127]→[5.185029:185082](∅→∅)
function App.focus(in_focus)if in_focus thenLast_focus_time = App.getTime()if Current_app == 'run' thenif run.focus then run.focus(in_focus) endelseif Current_app == 'source' thenif source.focus then source.focus(in_focus) endelseassert(false, 'unknown app "'..Current_app..'"')endif Current_app == nil thenCurrent_app = 'run' - resolve order conflict in main.lua at line 261[57.268]
- edit in Manual_tests.md at line 25
* Logging files created in the 'recent' file. - edit in Manual_tests.md at line 27
* Logging files created in the 'recent' file.