Merge lines.love
[?]
Nov 12, 2022, 2:06 AM
VO2ZVTWKGVKKIU6IM2SKMYKLK4FKR2VYJYMYP5TEAFGMS7TKEDIQCDependencies
- [2]
2CTN2IEFMerge lines.love - [3]
DW6SNODMsource editing: highlight [[ ]] comments/strings - [4]
XX7G2FFJintermingle freehand line drawings with text - [5]
TVCPXAAUrename - [6]
VHQCNMARseveral more modules - [7]
4YDBYBA4clean up memory leak experiments - [8]
BJ5X5O4Alet's prevent the text cursor from ever getting on a drawing - [9]
KMSL74GAsupport selections in the source editor - [10]
K2X6G75Zstart writing some tests for drawings - [11]
3PSFWAILMerge lines.love - [12]
ETXNVRPTMerge lines.love - [13]
TLOAPLBJadd a license - [14]
RPGTBMMMMerge lines.love - [15]
2L5MEZV3experiment: new edit namespace - [16]
RSZD5A7Gforgot to add json.lua - [17]
LXTTOB33extract a couple of files - [18]
D4B52CQ2Merge lines.love - [19]
GUOQRUL7Merge lines.love - [20]
OGUV4HSAremove some memory leaks from rendered fragments - [21]
KKMFQDR4editing source code from within the app - [22]
ATQO62TFMerge lines.love - [23]
3QNOKBFMbeginnings of a test harness - [24]
CE4LZV4Tdrop last couple of manual tests - [25]
AVTNUQYRbasic test-enabled framework - [26]
MD3W5IRAnew fork: rip out drawing support - [27]
VP5KC4XZMerge lines.love - [28]
66X36NZNa little more prose describing manual_tests - [29]
FS2ITYYHrecord a known issue - [30]
D2GCFTTTclean up repl functionality - [31]
32V6ZHQBMerge lines.love - [32]
BULPIBEGbeginnings of a module for the text editor - [33]
R5QXEHUIsomebody stop me - [34]
VBU5YHLRMerge lines.love - [35]
VHUNJHXBMerge lines.love - [36]
VXORMHMEdelete experimental REPL - [37]
JOPVPUSAediting source code from within the app - [38]
73OCE2MCafter much struggle, a brute-force undo - [39]
BLWAYPKVextract a module - [40]
6LJZN727handle chords - [41]
T4FRZSYLdelete an ancient, unused file - [42]
OTIBCAUJlove2d scaffold
Change contents
- file deletion: colorize.lua colorize.lua
if edge.suffix and rfind(frag, edge.suffix, nil, --[[plain]] true) == #frag - #edge.suffix + 1 thenCurrent_state = edge.targetbreakendendendfunction trim(s)return s:gsub('^%s+', ''):gsub('%s+$', '')endfunction ltrim(s)return s:gsub('^%s+', '')endfunction rtrim(s)return s:gsub('%s+$', '')enddstring=String_color,block_string=String_color,block_comment=Comment_color,}Current_state = 'normal'function initialize_color()--? print('new line')Current_state = 'normal'endfunction select_color(frag)--? print('before', '^'..frag..'$', Current_state)switch_color_based_on_prefix(frag)--? print('using color', Current_state, Colors[Current_state])App.color(Colors[Current_state])switch_color_based_on_suffix(frag)--? print('state after suffix', Current_state)endfunction switch_color_based_on_prefix(frag)if Next_state[Current_state] == nil thenreturnendfrag = rtrim(frag)for _,edge in pairs(Next_state[Current_state]) doif edge.prefix and find(frag, edge.prefix, nil, --[[plain]] true) == 1 thenCurrent_state = edge.targetbreakendendendfunction switch_color_based_on_suffix(frag)if Next_state[Current_state] == nil thenreturnendfrag = rtrim(frag)for _,edge in pairs(Next_state[Current_state]) docomment=Comment_color,sstring=String_color,Comment_color = {r=0, g=0, b=1}String_color = {r=0, g=0.5, b=0.5}Divider_color = {r=0.7, g=0.7, b=0.7}Colors = {normal=Text_color,block_string={{suffix=']]', target='normal'},},block_comment={{suffix=']]', target='normal'},},-- comments are a sink}{prefix='[[', target='block_string'}, -- only single line for now},dstring={{suffix='"', target='normal'},},sstring={{suffix="'", target='normal'},},{prefix='--[[', target='block_comment'}, -- only single-line for now{prefix='--', target='comment'},{prefix='"', target='dstring'},{prefix="'", target='sstring'}, - edit in colorize.lua at line 7
{prefix='--[[', target='block_comment'}, -- only single-line for now - edit in colorize.lua at line 11
{prefix='[[', target='block_string'}, -- only single line for now - edit in colorize.lua at line 19
block_string={{suffix=']]', target='normal'},},block_comment={{suffix=']]', target='normal'},}, - replacement in colorize.lua at line 28
Comments_color = {r=0, g=0, b=1}Comment_color = {r=0, g=0, b=1} - replacement in colorize.lua at line 34
comment=Comments_color,comment=Comment_color, - replacement in colorize.lua at line 36
dstring=String_colordstring=String_color,block_string=String_color,block_comment=Comment_color, - replacement in colorize.lua at line 76
if edge.suffix and rfind(frag, edge.suffix, nil, --[[plain]] true) == #frag thenif edge.suffix and rfind(frag, edge.suffix, nil, --[[plain]] true) == #frag - #edge.suffix + 1 then