Merge lines.love
[?]
Jul 11, 2023, 12:55 AM
RU4HIK436ZRQJEPZXFS4FQTYVRL7BK5NWKYFGHFHZQOEOBF7M5SQCDependencies
- [2]
3XNFQDDNMerge lines.love - [3]
EVMVBLXDbugfix: preserve window position - [4]
UZQ2LGHQbugfix: preserve window position - [5]
W5WCQNMPbugfix: Windows pushing title bar off screen - [6]
G75ITNUVstandardize between run and source some more - [7]
SGMA5JLEsave the list of tests in repo - [8]
ONHKBLLCMerge lines.love - [9]
K74U4BAUMerge lines.love - [10]
73OCE2MCafter much struggle, a brute-force undo - [11]
VHUNJHXBMerge lines.love - [12]
AYX33NBCMerge lines.love - [13]
KMSL74GAsupport selections in the source editor - [14]
4J4TX7ISget typed in keystrokes to show on screen on iPad - [15]
2L5MEZV3experiment: new edit namespace - [16]
S3PNFXTBhandle missing cursors in settings - [17]
NMRUNROTMerge lines.love - [18]
XX7G2FFJintermingle freehand line drawings with text - [19]
CQYKYJJUremember window positions across restart/ctrl+e - [20]
6LJZN727handle chords - [21]
AVTNUQYRbasic test-enabled framework - [22]
JOPVPUSAediting source code from within the app - [23]
QJISOCHJsome temporary logging to catch a bug - [24]
43WA37TUdelete flags that have never been exercised - [25]
BJ5X5O4Alet's prevent the text cursor from ever getting on a drawing - [26]
UI3IP45FMerge lines.love - [27]
SBR7ARVHsimplify saving settings - [28]
K2X6G75Zstart writing some tests for drawings - [29]
D76MS2G2Merge lines.love - [30]
VHQCNMARseveral more modules - [31]
4U4VQWNYMerge lines.love - [32]
P3K7UH5CMerge lines.love - [33]
VXORMHMEdelete experimental REPL - [34]
2CTN2IEFMerge lines.love - [35]
VP5KC4XZMerge lines.love - [36]
5RDWSYK2consistently use App names for methods everywhere - [37]
ZLJYLPOTMerge lines.love - [38]
N2NUGNN4include a brief reference enabling many useful apps - [39]
3PSFWAILMerge lines.love - [40]
FS2ITYYHrecord a known issue - [41]
TLOAPLBJadd a license - [42]
4YDBYBA4clean up memory leak experiments - [43]
KKMFQDR4editing source code from within the app - [44]
ZJOSQFN6bugfix: path munging on Windows - [45]
L2FWWEQLsource: remember cursor position of multiple files - [46]
LXTTOB33extract a couple of files - [47]
ORKN6EOBMerge lines.love - [48]
ORRSP7FVdeduce test names on failures - [49]
OTIBCAUJlove2d scaffold - [50]
A4BSGS2CMerge lines.love - [51]
ISOFHXB2App.width can no longer take a Text - [52]
QS3YLNKZMerge lines.love - [53]
5SM6DRHKport inscript's bugfix to source editor - [54]
TVCPXAAUrename - [55]
JDZVBFEIMerge lines.love - [56]
OMLASW7Kexperiment at avoiding some merge conflicts - [57]
NFI42KGXmore correct absolute path detection - [58]
OB5XOXVCdeemphasize the source editor - [59]
D2GCFTTTclean up repl functionality - [60]
4VQGE7RAnew test - [61]
A23MMLJHmigrate old settings, attempt #3 - [62]
SDO4DHNUsource: load cursor position from settings - [63]
4SR3Z4Y3document the version of LÖVE I've been using - [64]
3QNOKBFMbeginnings of a test harness - [65]
OGUV4HSAremove some memory leaks from rendered fragments - [66]
MD3W5IRAnew fork: rip out drawing support - [67]
JKENJ2UGMerge lines.love - [68]
DB7HJBHJMerge lines.love - [69]
JZR3QMTNMerge lines.love - [70]
RSZD5A7Gforgot to add json.lua - [71]
ATQO62TFMerge lines.love - [72]
BLWAYPKVextract a module - [73]
66X36NZNa little more prose describing manual_tests - [74]
DCO5BQWVMerge lines.love - [75]
BULPIBEGbeginnings of a module for the text editor - [76]
EMG7SDLWbugfix: cold start - [77]
T4FRZSYLdelete an ancient, unused file - [78]
C3NYQP57Merge lines.love - [79]
UUTUPEOJextract a function - [80]
R5QXEHUIsomebody stop me - [81]
LWPFEZBIMerge lines.love - [82]
CE4LZV4Tdrop last couple of manual tests - [83]
ENENSZLKbugfix: source margins when toggling log browser - [84]
2344TV56Merge lines.love - [85]
HCFDBUXHfix stale comment
Change contents
- file deletion: source_tests.lua source_tests.lua
function test_show_log_browser_side_splits_window_width()-- initialize screen dimensions and indicate that it is maximizedApp.screen.init{width=300, height=300} - file deletion: source.lua source.lua
-- set up desired window dimensions and make window resizable_, _, App.screen.flags = App.screen.size()App.screen.flags.resizable = trueApp.screen.width, App.screen.height = settings.width, settings.heightApp.screen.resize(App.screen.width, App.screen.height, App.screen.flags)Editor_state.right = App.screen.width - Margin_rightEditor_state.width = Editor_state.right-Editor_state.leftText.redraw_all(Editor_state)endEditor_state.width = Editor_state.right-Editor_state.leftText.redraw_all(Editor_state)Log_browser_state.left = App.screen.width/2 + Margin_leftLog_browser_state.right = App.screen.width - Margin_right-- Initialize window width/height and make window resizable.---- I get tempted to have opinions about window dimensions here, but they're-- non-portable:-- - maximizing doesn't work on mobile and messes things up-- - maximizing keeps the title bar on screen in Linux, but off screen on-- Windows. And there's no way to get the height of the title bar.-- It seems more robust to just follow LÖVE's default window size until-- someone overrides it.App.screen.width, App.screen.height, App.screen.flags = App.screen.size()Settings.source.x, Settings.source.y, Settings.source.displayindex = App.screen.position()File_navigation.cursors[Editor_state.filename] = {cursor1=Editor_state.cursor1, screen_top1=Editor_state.screen_top1}if Settings == nil then Settings = {} endif Settings.source == nil then Settings.source = {} endApp.screen.flags.resizable = truesource.set_window_position_from_settings(settings)Show_log_browser_side = settings.show_log_browser_sidelocal right = App.screen.width - Margin_rightif Show_log_browser_side thenright = App.screen.width/2 - Margin_rightendEditor_state = edit.initialize_state(Margin_top, Margin_left, right, settings.font_height, math.floor(settings.font_height*1.3))Editor_state.filename = settings.filenamelocal os = love.system.getOS()if os == 'Linux' then-- love.window.setPosition doesn't quite seem to do what is asked of it on Linux.App.screen.move(settings.x, settings.y-37, settings.displayindex)elseApp.screen.move(settings.x, settings.y, settings.displayindex)endendfunction source.initialize_default_settings()local font_height = 20love.graphics.setFont(love.graphics.newFont(font_height)) - file deletion: run.lua run.lua
-- set up desired window dimensions and make window resizable_, _, App.screen.flags = App.screen.size()-- Initialize window width/height and make window resizable.---- I get tempted to have opinions about window dimensions here, but they're-- non-portable:-- - maximizing doesn't work on mobile and messes things up-- - maximizing keeps the title bar on screen in Linux, but off screen on-- Windows. And there's no way to get the height of the title bar.-- It seems more robust to just follow LÖVE's default window size until-- someone overrides it.if Settings == nil then Settings = {} endSettings.x, Settings.y, Settings.displayindex = App.screen.position()return {App.screen.width, App.screen.height, App.screen.flags = App.screen.size()App.screen.flags.resizable = trueendfunction run.set_window_position_from_settings(settings)local os = love.system.getOS()if os == 'Linux' then-- love.window.setPosition doesn't quite seem to do what is asked of it on Linux.App.screen.move(settings.x, settings.y-37, settings.displayindex)elseApp.screen.move(settings.x, settings.y, settings.displayindex)endendfunction run.initialize_default_settings()local font_height = 20love.graphics.setFont(love.graphics.newFont(font_height))run.set_window_position_from_settings(Settings)Editor_state = edit.initialize_state(Margin_top, Margin_left, App.screen.width-Margin_right, Settings.font_height, math.floor(Settings.font_height*1.3))Editor_state.filename = Settings.filenameEditor_state.screen_top1 = Settings.screen_topEditor_state.cursor1 = Settings.cursor - edit in source_tests.lua at line 22
Display_width = App.screen.width - replacement in source_tests.lua at line 36[7.787]→[7.787:858](∅→∅),[7.934]→[7.934:1688](∅→∅),[7.1688]→[7.45:81](∅→∅),[7.81]→[7.1714:1775](∅→∅),[7.1714]→[7.1714:1775](∅→∅),[7.1775]→[7.23423:23474](∅→∅),[7.23474]→[7.1890:1927](∅→∅),[7.1890]→[7.1890:1927](∅→∅),[7.1927]→[7.23475:23594](∅→∅),[7.23594]→[7.2174:2212](∅→∅),[7.2174]→[7.2174:2212](∅→∅),[7.2212]→[7.23595:23758](∅→∅),[7.23758]→[7.2503:2595](∅→∅),[7.2503]→[7.2503:2595](∅→∅)
function test_show_log_browser_side_doubles_window_width_if_possible()-- initialize screen dimensions to half widthApp.screen.init{width=300, height=300}Display_width = App.screen.width*2-- initialize source app with left side occupying entire window (half the display)Current_app = 'source'Editor_state = edit.initialize_test_state()Editor_state.filename = 'foo'Editor_state.left = Margin_leftEditor_state.right = App.screen.width - Margin_rightlocal old_editor_right = Editor_state.rightText.redraw_all(Editor_state)Log_browser_state = edit.initialize_test_state()-- log browser has some arbitrary marginsLog_browser_state.left = 200 + Margin_leftLog_browser_state.right = 400Text.redraw_all(Log_browser_state)log_browser.parse(Log_browser_state)-- display log browserCurrent_time = Current_time + 0.1App.run_after_keychord('C-l')-- window width is doubledcheck_eq(App.screen.width, 600, 'display:width')-- left side margins are unchangedcheck_eq(Editor_state.left, Margin_left, 'edit:left')check_eq(Editor_state.right, old_editor_right, 'edit:right')-- log browser margins are adjustedcheck_eq(Log_browser_state.left, App.screen.width/2 + Margin_left, 'log:left')check_eq(Log_browser_state.right, App.screen.width - Margin_right, 'log:right')endfunction test_show_log_browser_side_resizes_both_sides_if_cannot_double_window_width()function test_show_log_browser_side_splits_window_width() - edit in source_tests.lua at line 39
Display_width = 300 - replacement in source.lua at line 124[7.168600]→[7.12:59](∅→∅),[7.59]→[7.169203:169289](∅→∅),[7.4504]→[7.169203:169289](∅→∅),[7.169203]→[7.169203:169289](∅→∅)
source.resize_window_from_settings(settings)--? print('loading source position', settings.x, settings.y, settings.displayindex)-- set up desired window dimensions and make window resizable_, _, App.screen.flags = App.screen.size()App.screen.flags.resizable = trueApp.screen.width, App.screen.height = settings.width, settings.heightApp.screen.resize(App.screen.width, App.screen.height, App.screen.flags) - replacement in source.lua at line 149
function source.resize_window_from_settings(settings)function source.set_window_position_from_settings(settings) - replacement in source.lua at line 151
if os == 'Android' or os == 'iOS' then-- maximizing on iOS breaks text rendering: https://github.com/deltadaedalus/vudu/issues/7-- no point second-guessing window dimensions on mobileApp.screen.width, App.screen.height, App.screen.flags = App.screen.size()returnif os == 'Linux' then-- love.window.setPosition doesn't quite seem to do what is asked of it on Linux.App.screen.move(settings.x, settings.y-37, settings.displayindex)elseApp.screen.move(settings.x, settings.y, settings.displayindex) - edit in source.lua at line 157
-- maximize window to determine maximum allowable dimensionsApp.screen.resize(0, 0) -- maximizeDisplay_width, Display_height, App.screen.flags = App.screen.size()-- set up desired window dimensionsApp.screen.flags.resizable = trueApp.screen.flags.minwidth = math.min(Display_width, 200)App.screen.flags.minheight = math.min(Display_height, 200)App.screen.width, App.screen.height = settings.width, settings.height--? print('setting window from settings:', App.screen.width, App.screen.height)App.screen.resize(App.screen.width, App.screen.height, App.screen.flags) - edit in source.lua at line 159[7.169801]→[7.169801:169861](∅→∅),[7.169861]→[7.1040:1192](∅→∅),[7.1192]→[7.170009:170014](∅→∅),[7.170009]→[7.170009:170014](∅→∅)
function source.set_window_position_from_settings(settings)-- love.window.setPosition doesn't quite seem to do what is asked of it on Linux.App.screen.move(settings.x, settings.y-37, settings.displayindex)end - replacement in source.lua at line 170[7.170525]→[7.1193:1517](∅→∅),[7.1517]→[7.170525:170546](∅→∅),[7.170525]→[7.170525:170546](∅→∅),[7.170546]→[7.4505:4614](∅→∅),[7.4614]→[7.170661:170796](∅→∅),[7.170661]→[7.170661:170796](∅→∅)
local os = love.system.getOS()if os == 'Android' or os == 'iOS' then-- maximizing on iOS breaks text rendering: https://github.com/deltadaedalus/vudu/issues/7-- no point second-guessing window dimensions on mobileApp.screen.width, App.screen.height, App.screen.flags = App.screen.size()returnend-- maximize windowApp.screen.resize(0, 0) -- maximizeDisplay_width, Display_height, App.screen.flags = App.screen.size()-- shrink height slightly to account for window decorationApp.screen.height = Display_height-100App.screen.width = 40*em_width-- Initialize window width/height and make window resizable.---- I get tempted to have opinions about window dimensions here, but they're-- non-portable:-- - maximizing doesn't work on mobile and messes things up-- - maximizing keeps the title bar on screen in Linux, but off screen on-- Windows. And there's no way to get the height of the title bar.-- It seems more robust to just follow LÖVE's default window size until-- someone overrides it.App.screen.width, App.screen.height, App.screen.flags = App.screen.size() - edit in source.lua at line 181
App.screen.flags.minwidth = math.min(App.screen.width, 200)App.screen.flags.minheight = math.min(App.screen.height, 200) - edit in source.lua at line 182
print('initializing source position')if Settings == nil then Settings = {} endif Settings.source == nil then Settings.source = {} endSettings.source.x, Settings.source.y, Settings.source.displayindex = App.screen.position() - replacement in source.lua at line 272[7.173790]→[7.173790:173872](∅→∅),[7.173872]→[7.4785:4880](∅→∅),[7.297]→[7.174157:174269](∅→∅),[7.647]→[7.174157:174269](∅→∅),[7.174157]→[7.174157:174269](∅→∅)
if Current_app == 'source' then--? print('reading source window position')Settings.source.x, Settings.source.y, Settings.source.displayindex = App.screen.position()end--? print('saving source settings', Settings.source.x, Settings.source.y, Settings.source.displayindex)if Settings == nil then Settings = {} endif Settings.source == nil then Settings.source = {} endSettings.source.x, Settings.source.y, Settings.source.displayindex = App.screen.position() - edit in source.lua at line 357
App.screen.width = math.min(Display_width, App.screen.width*2) - edit in source.lua at line 358
Editor_state.width = Editor_state.right-Editor_state.leftText.redraw_all(Editor_state) - replacement in source.lua at line 363[7.176525]→[7.176525:176662](∅→∅),[7.176662]→[7.5140:5217](∅→∅),[7.5217]→[7.176741:176893](∅→∅),[7.176741]→[7.176741:176893](∅→∅),[7.176893]→[7.12:106](∅→∅)
App.screen.width = Editor_state.right + Margin_rightend--? print('setting window:', App.screen.width, App.screen.height)App.screen.resize(App.screen.width, App.screen.height, App.screen.flags)--? print('done setting window')-- try to restore position if possible-- if the window gets wider the window manager may not respect thisif not App.run_tests thensource.set_window_position_from_settings(Settings.source)Editor_state.right = App.screen.width - Margin_rightEditor_state.width = Editor_state.right-Editor_state.leftText.redraw_all(Editor_state) - replacement in run.lua at line 58[7.179300]→[7.16:60](∅→∅),[7.60]→[7.1522:1598](∅→∅),[7.1598]→[7.179443:179481](∅→∅),[7.179443]→[7.179443:179481](∅→∅)
-- determine default dimensions and flagsApp.screen.width, App.screen.height, App.screen.flags = App.screen.size()-- set up desired window dimensions-- set up desired window dimensions and make window resizable_, _, App.screen.flags = App.screen.size() - edit in run.lua at line 61
App.screen.flags.minwidth = math.min(App.screen.width, 200)App.screen.flags.minheight = math.min(App.screen.height, 200) - replacement in run.lua at line 63
App.screen.move(Settings.x, Settings.y, Settings.displayindex)run.set_window_position_from_settings(Settings) - edit in run.lua at line 70
function run.set_window_position_from_settings(settings)local os = love.system.getOS()if os == 'Linux' then-- love.window.setPosition doesn't quite seem to do what is asked of it on Linux.App.screen.move(settings.x, settings.y-37, settings.displayindex)elseApp.screen.move(settings.x, settings.y, settings.displayindex)endend - replacement in run.lua at line 91[7.180688]→[7.1740:2064](∅→∅),[7.2064]→[7.180688:180709](∅→∅),[7.180688]→[7.180688:180709](∅→∅),[7.180709]→[7.2065:2104](∅→∅)
local os = love.system.getOS()if os == 'Android' or os == 'iOS' then-- maximizing on iOS breaks text rendering: https://github.com/deltadaedalus/vudu/issues/7-- no point second-guessing window dimensions on mobileApp.screen.width, App.screen.height, App.screen.flags = App.screen.size()returnend-- maximize windowApp.screen.resize(0, 0) -- maximize-- Initialize window width/height and make window resizable.---- I get tempted to have opinions about window dimensions here, but they're-- non-portable:-- - maximizing doesn't work on mobile and messes things up-- - maximizing keeps the title bar on screen in Linux, but off screen on-- Windows. And there's no way to get the height of the title bar.-- It seems more robust to just follow LÖVE's default window size until-- someone overrides it. - edit in run.lua at line 101
-- shrink height slightly to account for window decorationApp.screen.height = App.screen.height-100App.screen.width = 40*em_width - edit in run.lua at line 102
App.screen.flags.minwidth = math.min(App.screen.width, 200)App.screen.flags.minheight = math.min(App.screen.height, 200) - replacement in run.lua at line 153[7.182338]→[7.15:65](∅→∅),[7.65]→[7.89:120](∅→∅),[7.182338]→[7.89:120](∅→∅),[7.120]→[7.2257:2331](∅→∅),[7.485]→[7.182571:182577](∅→∅),[7.793]→[7.182571:182577](∅→∅),[7.182571]→[7.182571:182577](∅→∅)
if Settings == nil thenSettings = {}endif Current_app == 'run' thenSettings.x, Settings.y, Settings.displayindex = App.screen.position()endif Settings == nil then Settings = {} endSettings.x, Settings.y, Settings.displayindex = App.screen.position()