Merge lines.love
[?]
Mar 19, 2023, 6:59 AM
JKENJ2UGUCIHH27LSUZLVZIYOTUR3JDWUG453OFYTRL3V3IRQGTACDependencies
- [2]
2TQUKHBCMerge lines.love - [3]
5RDWSYK2consistently use App names for methods everywhere - [4]
4J4TX7ISget typed in keystrokes to show on screen on iPad - [5]
RSZD5A7Gforgot to add json.lua - [6]
R5QXEHUIsomebody stop me - [7]
UUTUPEOJextract a function - [8]
AOZX2G5Fsource: no commandline args - [9]
LXTTOB33extract a couple of files - [10]
OGUV4HSAremove some memory leaks from rendered fragments - [11]
CQYKYJJUremember window positions across restart/ctrl+e - [12]
A4BSGS2CMerge lines.love - [13]
T4FRZSYLdelete an ancient, unused file - [14]
K74U4BAUMerge lines.love - [15]
3PSFWAILMerge lines.love - [16]
EJOZAD7Ntypo - [17]
FS2ITYYHrecord a known issue - [18]
AVTNUQYRbasic test-enabled framework - [19]
XX7G2FFJintermingle freehand line drawings with text - [20]
4YDBYBA4clean up memory leak experiments - [21]
KKMFQDR4editing source code from within the app - [22]
ETXNVRPTMerge lines.love - [23]
VP5KC4XZMerge lines.love - [24]
ORKN6EOBMerge lines.love - [25]
EMG7SDLWbugfix: cold start - [26]
TVCPXAAUrename - [27]
CE4LZV4Tdrop last couple of manual tests - [28]
D2GCFTTTclean up repl functionality - [29]
4SR3Z4Y3document the version of LÖVE I've been using - [30]
HCFDBUXHfix stale comment - [31]
6LJZN727handle chords - [32]
3QNOKBFMbeginnings of a test harness - [33]
2CK5QI7Wmake love event names consistent - [34]
MD3W5IRAnew fork: rip out drawing support - [35]
JOPVPUSAediting source code from within the app - [36]
66X36NZNa little more prose describing manual_tests - [37]
D76MS2G2Merge lines.love - [38]
VHQCNMARseveral more modules - [39]
OTIBCAUJlove2d scaffold - [40]
VXORMHMEdelete experimental REPL - [41]
K2X6G75Zstart writing some tests for drawings - [42]
DB7HJBHJMerge lines.love - [43]
ZTZOO2OQMerge lines.love - [44]
S3PNFXTBhandle missing cursors in settings - [45]
JMUD7T3Oget rid of ugly side-effects in tests - [46]
L2FWWEQLsource: remember cursor position of multiple files - [47]
ATQO62TFMerge lines.love - [48]
BLWAYPKVextract a module - [49]
2L5MEZV3experiment: new edit namespace - [50]
A23MMLJHmigrate old settings, attempt #3 - [51]
U3MJNFUYMerge lines.love - [52]
VHUNJHXBMerge lines.love - [53]
BJ5X5O4Alet's prevent the text cursor from ever getting on a drawing - [54]
GUOQRUL7Merge lines.love - [55]
QS3YLNKZMerge lines.love - [56]
DCO5BQWVMerge lines.love - [57]
AYX33NBCMerge lines.love - [58]
2CTN2IEFMerge lines.love - [59]
BULPIBEGbeginnings of a module for the text editor - [60]
KMSL74GAsupport selections in the source editor - [61]
SDO4DHNUsource: load cursor position from settings - [62]
73OCE2MCafter much struggle, a brute-force undo - [63]
TLOAPLBJadd a license
Change contents
- file deletion: source.lua source.lua
endfunction source.resize_window_from_settings(settings)-- 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)endfunction source.set_window_position_from_settings(settings)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-- 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)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 windowendfunction source.initialize_default_settings()local font_height = 20love.graphics.setFont(love.graphics.newFont(font_height))local em = App.newText(love.graphics.getFont(), 'm')source.initialize_window_geometry(App.width(em))Editor_state = edit.initialize_state(Margin_top, Margin_left, App.screen.width-Margin_right)source.resize_window_from_settings(settings)--? print('loading source position', settings.x, settings.y, settings.displayindex)source.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.filename - file deletion: run.lua run.lua
Settings.x, Settings.y, Settings.displayindex = App.screen.position()endApp.screen.resize(App.screen.width, App.screen.height, App.screen.flags)endfunction run.resize(w, h)--? print(("Window resized to width: %d and height: %d."):format(w, h))App.screen.width, App.screen.height = w, hText.redraw_all(Editor_state)Editor_state.selection1 = {} -- no support for shift drag while we're resizingEditor_state.right = App.screen.width-Margin_rightEditor_state.width = Editor_state.right-Editor_state.leftText.tweak_screen_top_and_cursor(Editor_state, Editor_state.left, Editor_state.right)endApp.screen.resize(0, 0) -- maximizeApp.screen.width, App.screen.height, App.screen.flags = App.screen.size()-- shrink height slightly to account for window decorationApp.screen.height = App.screen.height-100App.screen.width = 40*em_widthApp.screen.flags.resizable = trueApp.screen.flags.minwidth = math.min(App.screen.width, 200)App.screen.resize(App.screen.width, App.screen.height, App.screen.flags)App.screen.move(Settings.x, Settings.y, Settings.displayindex)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 windowEditor_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.cursorendfunction run.initialize_default_settings()local font_height = 20love.graphics.setFont(love.graphics.newFont(font_height))local em = App.newText(love.graphics.getFont(), 'm')run.initialize_window_geometry(App.width(em))Editor_state = edit.initialize_state(Margin_top, Margin_left, App.screen.width-Margin_right)Editor_state.font_height = font_heightEditor_state.line_height = math.floor(font_height*1.3)Editor_state.em = emSettings = run.settings()endfunction run.initialize_window_geometry(em_width)App.screen.width, App.screen.height, App.screen.flags = App.screen.size()-- set up desired window dimensions - replacement in source.lua at line 108[5.168600]→[5.168600:168663](∅→∅),[5.168663]→[5.4319:4428](∅→∅),[5.4428]→[5.168778:169126](∅→∅),[5.168778]→[5.168778:169126](∅→∅),[5.169126]→[5.4429:4504](∅→∅)
-- 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)source.resize_window_from_settings(settings) - edit in source.lua at line 127
endendfunction source.resize_window_from_settings(settings)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()return - edit in source.lua at line 138
-- 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) - replacement in source.lua at line 151
-- setPosition doesn't quite seem to do what is asked of it on Linux.love.window.setPosition(settings.x, settings.y-37, settings.displayindex)-- 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) - edit in source.lua at line 168
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 - replacement in run.lua at line 51
App.screen.width, App.screen.height, App.screen.flags = love.window.getMode()App.screen.width, App.screen.height, App.screen.flags = App.screen.size() - replacement in run.lua at line 57
love.window.setMode(App.screen.width, App.screen.height, App.screen.flags)love.window.setPosition(Settings.x, Settings.y, Settings.displayindex)App.screen.resize(App.screen.width, App.screen.height, App.screen.flags)App.screen.move(Settings.x, Settings.y, Settings.displayindex) - edit in run.lua at line 78
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 - replacement in run.lua at line 86
love.window.setMode(0, 0) -- maximizeApp.screen.width, App.screen.height, App.screen.flags = love.window.getMode()App.screen.resize(0, 0) -- maximizeApp.screen.width, App.screen.height, App.screen.flags = App.screen.size() - replacement in run.lua at line 94
love.window.setMode(App.screen.width, App.screen.height, App.screen.flags)App.screen.resize(App.screen.width, App.screen.height, App.screen.flags) - replacement in run.lua at line 141
Settings.x, Settings.y, Settings.displayindex = love.window.getPosition()Settings.x, Settings.y, Settings.displayindex = App.screen.position()