Merge lines.love
[?]
Apr 2, 2023, 4:22 PM
ZLJYLPOTXIVBVWJ4NTRM2YCQPT2FCSN7446P56MJFEFY45QTB7IACDependencies
- [2]
GUOQRUL7Merge lines.love - [3]
ETXNVRPTMerge lines.love - [4]
MQTFTTEKMerge lines.love - [5]
REAIVN7WMerge lines.love - [6]
PNHUONCTupdate documentation on fragments - [7]
GGWAHCLEminor cleanup and a todo for later - [8]
HR6MLUTXshow count of test failures - [9]
I64IPGJXavoid saving fragments in lines - [10]
H4R5BHVYno more Text allocations - [11]
TVCPXAAUrename - [12]
TLOAPLBJadd a license - [13]
ORRSP7FVdeduce test names on failures - [14]
4SR3Z4Y3document the version of LÖVE I've been using - [15]
GQKUD7QXdelete some logs - [16]
AJB4LFRBtry to maintain a reasonable line width - [17]
LAW2O3NWextract variable Margin_left - [18]
2L5MEZV3experiment: new edit namespace - [19]
PFT5Y2ZYmove - [20]
H22OAXWEcouple of TODOs - [21]
AVTNUQYRbasic test-enabled framework - [22]
HIKLULFQextract a function - [23]
FNJF2FMQbugfix: online help - [24]
JKENJ2UGMerge lines.love - [25]
FBVUNLS4clean up some debug prints - [26]
LZYLOTP3rename - [27]
OYVFFWBKmove - [28]
BJ5X5O4Alet's prevent the text cursor from ever getting on a drawing - [29]
HOSPP2ANcrisp font rendering - [30]
ZQZX364Vuse a helper - [31]
NYRESFK6source: show all files in navigator - [32]
MP2TBKU6bugfix: crash in Text.up() after return - [33]
NDHQN23Gdone passing left/right margins everywhere - [34]
OI4FPFINsupport drawings in the source editor - [35]
6LJZN727handle chords - [36]
VXORMHMEdelete experimental REPL - [37]
L2FWWEQLsource: remember cursor position of multiple files - [38]
VP5KC4XZMerge lines.love - [39]
CE4LZV4Tdrop last couple of manual tests - [40]
MUJTM6REbring back a level of wrapping - [41]
FFAPDHHHshow partial items in the menu - [42]
ORKN6EOBMerge lines.love - [43]
FS2ITYYHrecord a known issue - [44]
UPCIYZEUdrop an unnecessary level of indent - [45]
OTIBCAUJlove2d scaffold - [46]
ZTZOO2OQMerge lines.love - [47]
LF7BWEG4group all editor globals - [48]
MD3W5IRAnew fork: rip out drawing support - [49]
K74U4BAUMerge lines.love - [50]
RPGTBMMMMerge lines.love - [51]
4KC7I3E2make colors easier to edit - [52]
U3MJNFUYMerge lines.love - [53]
DCO5BQWVMerge lines.love - [54]
XX7G2FFJintermingle freehand line drawings with text - [55]
3PSFWAILMerge lines.love - [56]
3QWK3GSAsupport mouse clicks in file navigator - [57]
XW7ANEJXswitch shortcuts for bifold text - [58]
2TQUKHBCMerge lines.love - [59]
UN7GKYV5support hyperlinks in the source editor - [60]
X3F7ECSLadd state arg to some functions - [61]
VHUNJHXBMerge lines.love - [62]
R5QXEHUIsomebody stop me - [63]
66X36NZNa little more prose describing manual_tests - [64]
VOU73AK6Merge lines.love - [65]
2L4DL7PGgo through App in a couple more places - [66]
FZBXBUFFbugfix: search - [67]
ASP5RVZAMerge lines.love - [68]
MTJEVRJRadd state arg to a few functions - [69]
KKMFQDR4editing source code from within the app - [70]
4YDBYBA4clean up memory leak experiments - [71]
J2SVGR2Eexperiment: blinking cursor - [72]
VJ77YABHmore efficient undo/redo - [73]
P3K7UH5CMerge lines.love - [74]
BULPIBEGbeginnings of a module for the text editor - [75]
3QNOKBFMbeginnings of a test harness - [76]
CQYKYJJUremember window positions across restart/ctrl+e - [77]
AOZX2G5Fsource: no commandline args - [78]
HALS7E5Umore clearly skip prints before screen top - [79]
KYNGDE2Cconsistent names in a few more places - [80]
VHQCNMARseveral more modules - [81]
ISOFHXB2App.width can no longer take a Text - [82]
S2QMLRXLstop creating a singleton table for every word - [83]
T4FRZSYLdelete an ancient, unused file - [84]
7JH2ZT3Fadd state arg to Drawing.draw - [85]
OGUV4HSAremove some memory leaks from rendered fragments - [86]
TFM6F5ODMerge lines.love - [87]
QFTLLRGLindent - [88]
QYIFOHW3first test! - [89]
LXTTOB33extract a couple of files - [90]
A4BSGS2CMerge lines.love - [91]
2CK5QI7Wmake love event names consistent - [92]
G54H3YG2get rid of all bifold text - [93]
BLWAYPKVextract a module - [94]
2CTN2IEFMerge lines.love - [95]
Q7XPSKIIMerge lines.love - [96]
4U4VQWNYMerge lines.love - [97]
FUOURDEYclean up some final bifold code - [98]
D3FLL7SLstart showing source menu file navigation state graphically - [99]
R3KXFRZNget rid of to_text - [100]
MDGHRTIFsource: up/down in file navigator - [101]
QZ2SXLHFsome debug prints - [102]
JJDUDMVXMerge lines.love - [103]
KWOJ6XHEcut/copy selected text to clipboard - [104]
VBU5YHLRMerge lines.love - [105]
HGC5RGJPswitch to line index in a function - [106]
KMSL74GAsupport selections in the source editor - [107]
5RDWSYK2consistently use App names for methods everywhere - [108]
2Y7YH7UPinfrastructure for caching LÖVE text objects - [109]
D4B52CQ2Merge lines.love - [110]
V5SYDHPQstart thinking of compute_fragments as a detail - [111]
AH744RFRshow when we're naming a point - [112]
D2GCFTTTclean up repl functionality - [113]
K2X6G75Zstart writing some tests for drawings - [114]
JOPVPUSAediting source code from within the app - [115]
XS3PZI7GMerge lines.love - [116]
73OCE2MCafter much struggle, a brute-force undo - [117]
P4376EXKadd state arg to few functions - [118]
RSZD5A7Gforgot to add json.lua - [119]
RQUVBX62filter candidates in file navigator - [120]
ATQO62TFMerge lines.love
Change contents
- file deletion: help.lua
function draw_help_without_mouse_pressed(State, drawing_index)local drawing = State.lines[drawing_index]local line_cache = State.line_cache[drawing_index]App.color(Help_color)local y = line_cache.starty+10love.graphics.print("Things you can do:", State.left+30,y)y = y + State.line_heightlove.graphics.print("* Press the mouse button to start drawing a "..current_shape(State), State.left+30,y)y = y + State.line_heightlove.graphics.print("* Hover on a point and press 'ctrl+u' to pick it up and start moving it,", State.left+30,y)y = y + State.line_heightlove.graphics.print("then press the mouse button to drop it", State.left+30+bullet_indent(),y)y = y + State.line_heightlove.graphics.print("* Hover on a point and press 'ctrl+n', type a name, then press 'enter'", State.left+30,y)y = y + State.line_heightlove.graphics.print("* Hover on a point or shape and press 'ctrl+d' to delete it", State.left+30,y)y = y + State.line_heightif State.current_drawing_mode ~= 'freehand' thenlove.graphics.print("* Press 'ctrl+p' to switch to drawing freehand strokes", State.left+30,y)y = y + State.line_heightendif State.current_drawing_mode ~= 'line' thenlove.graphics.print("* Press 'ctrl+l' to switch to drawing lines", State.left+30,y)y = y + State.line_heightendif State.current_drawing_mode ~= 'manhattan' thenlove.graphics.print("* Press 'ctrl+m' to switch to drawing horizontal/vertical lines", State.left+30,y)y = y + State.line_heightendif State.current_drawing_mode ~= 'circle' thenlove.graphics.print("* Press 'ctrl+o' to switch to drawing circles/arcs", State.left+30,y)y = y + State.line_heightendif State.current_drawing_mode ~= 'polygon' thenlove.graphics.print("* Press 'ctrl+g' to switch to drawing polygons", State.left+30,y)y = y + State.line_heightendif State.current_drawing_mode ~= 'rectangle' thenlove.graphics.print("* Press 'ctrl+r' to switch to drawing rectangles", State.left+30,y)y = y + State.line_heightendif State.current_drawing_mode ~= 'square' thenlove.graphics.print("* Press 'ctrl+s' to switch to drawing squares", State.left+30,y)y = y + State.line_heightendlove.graphics.print("* Press 'ctrl+=' or 'ctrl+-' to zoom in or out, ctrl+0 to reset zoom", State.left+30,y)y = y + State.line_heightlove.graphics.print("Press 'esc' now to hide this message", State.left+30,y)y = y + State.line_heightApp.color(Help_background_color)love.graphics.rectangle('fill', State.left,line_cache.starty, State.width, math.max(Drawing.pixels(drawing.h, State.width),y-line_cache.starty))endfunction draw_help_with_mouse_pressed(State, drawing_index)local drawing = State.lines[drawing_index]local line_cache = State.line_cache[drawing_index]App.color(Help_color)local y = line_cache.starty+10love.graphics.print("You're currently drawing a "..current_shape(State, drawing.pending), State.left+30,y)y = y + State.line_heightlove.graphics.print('Things you can do now:', State.left+30,y)y = y + State.line_heightif State.current_drawing_mode == 'freehand' thenlove.graphics.print('* Release the mouse button to finish drawing the stroke', State.left+30,y)y = y + State.line_heightelseif State.current_drawing_mode == 'line' or State.current_drawing_mode == 'manhattan' thenlove.graphics.print('* Release the mouse button to finish drawing the line', State.left+30,y)y = y + State.line_heightelseif State.current_drawing_mode == 'circle' thenif drawing.pending.mode == 'circle' thenlove.graphics.print('* Release the mouse button to finish drawing the circle', State.left+30,y)y = y + State.line_heightlove.graphics.print("* Press 'a' to draw just an arc of a circle", State.left+30,y)elselove.graphics.print('* Release the mouse button to finish drawing the arc', State.left+30,y)endy = y + State.line_heightelseif State.current_drawing_mode == 'polygon' thenlove.graphics.print('* Release the mouse button to finish drawing the polygon', State.left+30,y)y = y + State.line_heightlove.graphics.print("* Press 'p' to add a vertex to the polygon", State.left+30,y)y = y + State.line_heightelseif State.current_drawing_mode == 'rectangle' thenif #drawing.pending.vertices < 2 thenlove.graphics.print("* Press 'p' to add a vertex to the rectangle", State.left+30,y)y = y + State.line_heightelselove.graphics.print('* Release the mouse button to finish drawing the rectangle', State.left+30,y)y = y + State.line_heightlove.graphics.print("* Press 'p' to replace the second vertex of the rectangle", State.left+30,y)y = y + State.line_heightendelseif State.current_drawing_mode == 'square' thenif #drawing.pending.vertices < 2 thenlove.graphics.print("* Press 'p' to add a vertex to the square", State.left+30,y)y = y + State.line_heightelselove.graphics.print('* Release the mouse button to finish drawing the square', State.left+30,y)y = y + State.line_heightlove.graphics.print("* Press 'p' to replace the second vertex of the square", State.left+30,y)y = y + State.line_heightendendlove.graphics.print("* Press 'esc' then release the mouse button to cancel the current shape", State.left+30,y)y = y + State.line_heighty = y + State.line_heightif State.current_drawing_mode ~= 'line' thenlove.graphics.print("* Press 'l' to switch to drawing lines", State.left+30,y)y = y + State.line_heightendif State.current_drawing_mode ~= 'manhattan' thenlove.graphics.print("* Press 'm' to switch to drawing horizontal/vertical lines", State.left+30,y)y = y + State.line_heightendif State.current_drawing_mode ~= 'circle' thenlove.graphics.print("* Press 'o' to switch to drawing circles/arcs", State.left+30,y)y = y + State.line_heightendif State.current_drawing_mode ~= 'polygon' thenlove.graphics.print("* Press 'g' to switch to drawing polygons", State.left+30,y)y = y + State.line_heightendif State.current_drawing_mode ~= 'rectangle' thenlove.graphics.print("* Press 'r' to switch to drawing rectangles", State.left+30,y)y = y + State.line_heightendif State.current_drawing_mode ~= 'square' thenlove.graphics.print("* Press 's' to switch to drawing squares", State.left+30,y)y = y + State.line_heightendApp.color(Help_background_color)love.graphics.rectangle('fill', State.left,line_cache.starty, State.width, math.max(Drawing.pixels(drawing.h, State.width),y-line_cache.starty))endfunction current_shape(State, shape)if State.current_drawing_mode == 'freehand' thenreturn 'freehand stroke'elseif State.current_drawing_mode == 'line' thenreturn 'straight line'elseif State.current_drawing_mode == 'manhattan' thenreturn 'horizontal/vertical line'elseif State.current_drawing_mode == 'circle' and shape and shape.start_angle thenreturn 'arc'elsereturn State.current_drawing_modeendendfunction bullet_indent()return App.width(to_text('* '))end - file deletion: source_undo.lua source_undo.lua
table.insert(event.lines, {mode='drawing', h=line.h, points=deepcopy(line.points), shapes=deepcopy(line.shapes), pending={}})elseprint(line.mode)assert(false)endtable.insert(event.lines, {mode='text', data=line.data}) -- I've forgotten: should we deepcopy(line.data)?elseif line.mode == 'drawing' then - file deletion: source_text.lua source_text.lua
local trimmed_word = rtrim(f) -- compute_fragments puts whitespace at the endtable.insert(line_cache.fragments, frag)endx = x + frag_widthendendtable.insert(line_cache.fragments, frag1)frag = string.sub(frag, boffset)pos = pos + utf8.len(f)endendfunction Text.compute_fragments(State, line_index)local frag_width = App.width(f)if x + frag_width > State.right thenx = State.lefttable.insert(line_cache.screen_line_starting_pos, pos)endx = x + frag_widthText.draw_cursor(State, x+Text.x(f, State.cursor1.pos-pos+1), y)App.color(Text_color)endendendx = x + frag_widthendpos = pos + frag_lenendApp.screen.print(f, x,y)-- render cursor if necessaryif starts_with(trimmed_word, '[[') and ends_with(trimmed_word, ']]') thenlocal filename = trimmed_word:gsub('^..(.*)..$', '%1')if source.link_exists(State, filename) thenlocal frag_width = App.width(f)if x + frag_width > State.right thenassert(x > State.left) -- no overfull linesy = y + State.line_heightif y + State.line_height > App.screen.height thenreturn App.width(s_before)endfunction Text.to2(State, loc1)--? print('skipping', f)else-- render fragmentreturn App.width(s_before)endfunction Text.x(s, pos)local offset = Text.offset(s, pos)local s_before = s:sub(1, offset-1)return App.width(screen_line)endfrag_width = App.width(frag)endx = State.left -- new lineendif #frag > 0 thenselect_color(f)local frag_len = utf8.len(f)--? print('text.draw:', f, 'at', line_index,pos, 'after', x,y)if pos < startpos then-- render nothinglocal frag1_width = App.width(frag1)local frag_width = App.width(frag)Text.populate_screen_line_starting_pos(State, line_index)local pos = 1initialize_color()for _, f in ipairs(line_cache.fragments) doApp.color(Text_color)button(State, 'link', {x=x+App.width('[['), y=y, w=App.width(filename), h=State.line_height, color={1,1,1},icon = icon.hyperlink_decoration,onpress1 = function()source.switch_to_file(filename)end,})endend - file deletion: source_file.lua source_file.lua
line_info.data = linetable.insert(result, line_info)table.insert(result, {mode='text', data=line})end - file deletion: source_edit.lua source_edit.lua
-- fragments: snippets of the line guaranteed to not straddle screen lines-- screen_line_starting_pos: optional array of grapheme indices if it wraps over more than one screen lineline_cache = {},-- Given wrapping, any potential location for the text cursor can be described in two ways:-- * schema 1: As a combination of line index and position within a line (in utf8 codepoint units)-- * schema 2: As a combination of line index, screen line index within the line, and a position within the screen line. - file deletion: source.lua source.lua
source.initialize_window_geometry(App.width('m'))Editor_state = edit.initialize_state(Margin_top, Margin_left, App.screen.width-Margin_right) - file deletion: run.lua run.lua
run.initialize_window_geometry(App.width('m'))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)function width(s)return love.graphics.getFont():getWidth(s)end - file deletion: log_browser.lua log_browser.lua
love.graphics.print(line.section_stack[i].name, x, App.screen.height-App.width(line.section_stack[i].name)-5, --[[vertically]] math.pi/2)endendreturn log_browser.right_margin(State, line)endfunction should_show(line)-- Show a line if every single section it's in is expanded.for i=1,#line.section_stack dolocal section = line.section_stack[i]if not section.expanded thenreturn falseendendreturn trueendfunction log_browser.left_margin(State, line)return State.left + #line.section_stack*Section_border_padding_horizontalendfunction log_browser.right_margin(State, line)return State.right - #line.section_stack*Section_border_padding_horizontalendfunction log_browser.update(State, dt)endfunction log_browser.quit(State)endlove.graphics.print(line.section_stack[i].name, x+State.font_height+5, App.screen.height-App.width(line.section_stack[i].name)-5, --[[vertically]] math.pi/2)endendreturn log_browser.left_margin(State, line)endfunction render_stack_right_margin(State, line_index, line, y)App.color(Section_border_color)for i=1,#line.section_stack dolocal x = State.right - (i-1)*Section_border_padding_horizontallove.graphics.line(x,y, x,y+log_browser.height(State, line_index))if y < 30 thenlove.graphics.print(line.section_stack[i].name, x, y+5, --[[vertically]] math.pi/2)endif y > App.screen.height-log_browser.height(State, line_index) thenlove.graphics.print(line.section_name, xleft+50,y)love.graphics.line(xleft+50+App.width(line.section_name)+2,sectiony, xright,sectiony)endelseif type(line.data) == 'string' thenlocal old_left, old_right = State.left,State.rightState.left,State.right = xleft,xrighty = Text.draw(State, line_index, y, --[[startpos]] 1)State.left,State.right = old_left,old_rightelseheight = log_render[line.data.name](line.data, xleft, y, xright-xleft)endendif App.mouse_x() > Log_browser_state.left and line_index == mouse_line_index thenApp.color(Cursor_line_background_color)love.graphics.rectangle('fill', xleft,y, xright-xleft, height)endy = y + heightendendendfunction render_stack_left_margin(State, line_index, line, y)if line.section_stack == nil then-- assertion messagefor k,v in pairs(line) doprint(k)endendApp.color(Section_border_color)for i=1,#line.section_stack dolocal x = State.left + (i-1)*Section_border_padding_horizontallove.graphics.line(x,y, x,y+log_browser.height(State, line_index))if y < 30 thenlove.graphics.print(line.section_stack[i].name, x+State.font_height+5, y+5, --[[vertically]] math.pi/2)endif y > App.screen.height-log_browser.height(State, line_index) thenlove.graphics.print(line.section_name, xleft+50,y)love.graphics.line(xleft+50+App.width(line.section_name)+2,sectiony, xright,sectiony)else assert(line.section_end)local sectiony = y+State.line_height-Section_border_padding_verticallove.graphics.line(xleft,y, xleft,sectiony)love.graphics.line(xright,y, xright,sectiony)love.graphics.line(xleft,sectiony, xleft+50-2,sectiony) - file deletion: commands.lua commands.lua
local width = App.width(filename)if x + width > App.screen.width - 5 theny = y + Editor_state.line_heightx = 5local width = App.width(filename)if x + width > App.screen.width - 5 theny = y + Editor_state.line_heightx = 5endif i == index thenreturn y, x, widthendx = x + width + 30endendfunction file_index(fy, fx, fwidth)log_start('file index')log(2, ('for %d %d %d'):format(fy, fx, fwidth))local y,x = Menu_status_bar_height, 5local best_guess, best_guess_x, best_guess_widthfor i,filename in ipairs(File_navigation.candidates) doApp.screen.print(filename, x + x3-menu_xmin, y3)endx3 = x3 + width + 30end--return h+20width = App.width(filename)if x3 + width > App.screen.width - 5 theny3 = y3 + Editor_state.line_heightx3 = 0endif i == o.index thenApp.color(Menu_highlight_color)love.graphics.rectangle('fill', x + x3-menu_xmin - 5, y3-2, width+5*2, Editor_state.line_height+2*2)endif x3 >= menu_xmin and x3 + width < menu_xmax thenApp.color(Menu_command_color)width = App.width(filename)if x2 + width > App.screen.width - 5 theny2 = y2 + Editor_state.line_heightx2 = 0endif i == o.index thenbreakendx2 = x2 + width + 30App.screen.print(s, x,y)x = x + width + 30return x,ylocal width = App.width(s)if x + width > App.screen.width - 5 theny = y + Editor_state.line_heightx = 5endlocal width = App.width(filename)if x + width > App.screen.width - 5 thenresult = result+1x = 5 + widthelsex = x + width + 30endApp.screen.print(File_navigation.filter, 5, 5)draw_cursor(5 + App.width(File_navigation.filter), 5)if File_navigation.num_lines == nil thenApp.screen.print(s, Menu_cursor,5)Menu_cursor = Menu_cursor + width + 30endfunction source.draw_file_navigator()local width = App.width(s)if Menu_cursor > App.screen.width - 30 then - edit in undo.lua at line 61[10.33]→[10.33:81](∅→∅),[10.1624]→[7.1:115](∅→∅),[10.1624]→[7.1:115](∅→∅),[10.1726]→[7.116:248](∅→∅),[10.1726]→[7.116:248](∅→∅)
table.insert(event.lines, {data=line.data})table.insert(event.lines, {mode='text', data=line.data}) -- I've forgotten: should we deepcopy(line.data)?table.insert(event.lines, {mode='drawing', h=line.h, points=deepcopy(line.points), shapes=deepcopy(line.shapes), pending={}}) - resolve order conflict in undo.lua at line 61[10.33]
- edit in undo.lua at line 61
table.insert(event.lines, {data=line.data}) -- I've forgotten: should we deepcopy(line.data)? - resurrect zombie in text.lua at line 37
if State.lines[State.cursor1.line].data:sub(State.cursor1.pos, State.cursor1.pos+utf8.len(State.search_term)-1) == State.search_term then - resurrect zombie in text.lua at line 38
local lo_px = Text.draw_highlight(State, line, State.left,y, pos, State.cursor1.pos, State.cursor1.pos+utf8.len(State.search_term)) - resolve order conflict in text.lua at line 38
- resurrect zombie in text.lua at line 88
for frag in line.data:gmatch('%S*%s*') do - replacement in source_undo.lua at line 64
table.insert(event.lines, {mode='text', data=line.data, dataB=line.dataB})table.insert(event.lines, {mode='text', data=line.data}) -- I've forgotten: should we deepcopy(line.data)? - replacement in source_undo.lua at line 66
local points=deepcopy(line.points)--? print('copying', line.points, 'with', #line.points, 'points into', points)local shapes=deepcopy(line.shapes)--? print('copying', line.shapes, 'with', #line.shapes, 'shapes into', shapes)table.insert(event.lines, {mode='drawing', h=line.h, points=points, shapes=shapes, pending={}})--? table.insert(event.lines, {mode='drawing', h=line.h, points=deepcopy(line.points), shapes=deepcopy(line.shapes), pending={}})table.insert(event.lines, {mode='drawing', h=line.h, points=deepcopy(line.points), shapes=deepcopy(line.shapes), pending={}}) - replacement in source_text.lua at line 15
Text.compute_fragments(State, line_index)Text.populate_screen_line_starting_pos(State, line_index) - replacement in source_text.lua at line 20
local frag, frag_text = f.data, f.textselect_color(frag)local frag_len = utf8.len(frag)--? print('text.draw:', frag, 'at', line_index,pos, 'after', x,y)select_color(f)local frag_len = utf8.len(f)--? print('text.draw:', f, 'at', line_index,pos, 'after', x,y) - replacement in source_text.lua at line 25
--? print('skipping', frag)--? print('skipping', f) - replacement in source_text.lua at line 28
local frag_width = App.width(frag_text)local frag_width = App.width(f) - replacement in source_text.lua at line 43
local trimmed_word = rtrim(frag) -- compute_fragments puts whitespace at the endlocal trimmed_word = rtrim(f) -- compute_fragments puts whitespace at the end - replacement in source_text.lua at line 47
local filename_text = App.newText(love.graphics.getFont(), filename)button(State, 'link', {x=x+App.width(to_text('[[')), y=y, w=App.width(filename_text), h=State.line_height, color={1,1,1},button(State, 'link', {x=x+App.width('[['), y=y, w=App.width(filename), h=State.line_height, color={1,1,1}, - replacement in source_text.lua at line 55
App.screen.draw(frag_text, x,y)App.screen.print(f, x,y) - replacement in source_text.lua at line 66
Text.draw_cursor(State, x+Text.x(frag, State.cursor1.pos-pos+1), y)Text.draw_cursor(State, x+Text.x(f, State.cursor1.pos-pos+1), y) - edit in source_text.lua at line 106
local frag, frag_text = f.data, f.text - replacement in source_text.lua at line 107
local frag_width = App.width(frag_text)local frag_width = App.width(f) - replacement in source_text.lua at line 113
local frag_len = utf8.len(frag)pos = pos + frag_lenpos = pos + utf8.len(f) - edit in source_text.lua at line 118
--? print('compute_fragments', line_index, 'between', State.left, State.right) - replacement in source_text.lua at line 128
local frag_text = App.newText(love.graphics.getFont(), frag)local frag_width = App.width(frag_text)--? print('x: '..tostring(x)..'; frag_width: '..tostring(frag_width)..'; '..tostring(State.right-x)..'px to go')local frag_width = App.width(frag) - edit in source_text.lua at line 130
--? print(('checking whether to split fragment ^%s$ of width %d when rendering from %d'):format(frag, frag_width, x)) - edit in source_text.lua at line 131
--? print('splitting') - edit in source_text.lua at line 134
--? print('bpos', bpos) - edit in source_text.lua at line 136
--? print('space for '..tostring(bpos)..' graphemes, '..tostring(boffset-1)..' bytes') - replacement in source_text.lua at line 137
local frag1_text = App.newText(love.graphics.getFont(), frag1)local frag1_width = App.width(frag1_text)--? print('extracting ^'..frag1..'$ of width '..tostring(frag1_width)..'px')local frag1_width = App.width(frag1) - replacement in source_text.lua at line 139
table.insert(line_cache.fragments, {data=frag1, text=frag1_text})table.insert(line_cache.fragments, frag1) - replacement in source_text.lua at line 141
frag_text = App.newText(love.graphics.getFont(), frag)frag_width = App.width(frag_text)frag_width = App.width(frag) - replacement in source_text.lua at line 146
--? print('inserting ^'..frag..'$ of width '..tostring(frag_width)..'px')table.insert(line_cache.fragments, {data=frag, text=frag_text})table.insert(line_cache.fragments, frag) - replacement in source_text.lua at line 764
local screen_line_text = App.newText(love.graphics.getFont(), screen_line)return App.width(screen_line_text)return App.width(screen_line) - replacement in source_text.lua at line 852
local text_before = App.newText(love.graphics.getFont(), s_before)return App.width(text_before)return App.width(s_before) - replacement in source_text.lua at line 858
local text_before = App.newText(love.graphics.getFont(), s_before)return App.width(text_before)return App.width(s_before) - edit in source_file.lua at line 2
Fold = '\x1e' -- ASCII RS (record separator) - replacement in source_file.lua at line 29
local line_info = {mode='text'}if line:find(Fold) then_, _, line_info.data, line_info.dataB = line:find('([^'..Fold..']*)'..Fold..'([^'..Fold..']*)')elseline_info.data = lineendtable.insert(result, line_info)table.insert(result, {mode='text', data=line}) - edit in source_file.lua at line 49
if line.dataB and #line.dataB > 0 thenoutfile:write(Fold)outfile:write(line.dataB)end - replacement in source_file.lua at line 138
if line:find(Fold) then_, _, line_info.data, line_info.dataB = line:find('([^'..Fold..']*)'..Fold..'([^'..Fold..']*)')elseline_info.data = lineendline_info.data = line - replacement in source_edit.lua at line 57
-- fragments: snippets of rendered love.graphics.Text, guaranteed to not straddle screen lines-- fragments: snippets of the line guaranteed to not straddle screen lines - edit in source_edit.lua at line 91
em = App.newText(love.graphics.getFont(), 'm'), -- widest possible character width - edit in source_edit.lua at line 106
search_text = nil, - edit in source_edit.lua at line 326
State.search_text = nil - edit in source_edit.lua at line 356
State.search_text = nil - edit in source_edit.lua at line 362
State.search_text = nil - edit in source_edit.lua at line 367
State.search_text = nil - edit in source_edit.lua at line 380
assert(State.search_text == nil) - edit in source_edit.lua at line 511
State.em = App.newText(love.graphics.getFont(), 'm') - replacement in source.lua at line 165
local em = App.newText(love.graphics.getFont(), 'm')source.initialize_window_geometry(App.width(em))source.initialize_window_geometry(App.width('m')) - edit in source.lua at line 170
Editor_state.em = em - edit in source.lua at line 417
endend-- use this sparinglyfunction to_text(s)if Text_cache[s] == nil thenText_cache[s] = App.newText(love.graphics.getFont(), s) - edit in source.lua at line 418
return Text_cache[s] - resurrect zombie in select.lua at line 60
local before = line.data:sub(pos_offset, lo_offset-1) - resurrect zombie in select.lua at line 61
lo_px = App.width(before) - resolve order conflict in select.lua at line 61
- resurrect zombie in select.lua at line 64
local s = line.data:sub(lo_offset, hi_offset-1) - replacement in run.lua at line 74
local em = App.newText(love.graphics.getFont(), 'm')run.initialize_window_geometry(App.width(em))run.initialize_window_geometry(App.width('m')) - edit in run.lua at line 78
Editor_state.em = em - replacement in run.lua at line 198
-- use this sparinglyfunction to_text(s)if Text_cache[s] == nil thenText_cache[s] = App.newText(love.graphics.getFont(), s)endreturn Text_cache[s]function width(s)return love.graphics.getFont():getWidth(s) - edit in log_browser.lua at line 101
local section_text = to_text(line.section_name) - replacement in log_browser.lua at line 106
love.graphics.draw(section_text, xleft+50,y)love.graphics.line(xleft+50+App.width(section_text)+2,sectiony, xright,sectiony)love.graphics.print(line.section_name, xleft+50,y)love.graphics.line(xleft+50+App.width(line.section_name)+2,sectiony, xright,sectiony) - replacement in log_browser.lua at line 113
love.graphics.draw(section_text, xleft+50,y)love.graphics.line(xleft+50+App.width(section_text)+2,sectiony, xright,sectiony)love.graphics.print(line.section_name, xleft+50,y)love.graphics.line(xleft+50+App.width(line.section_name)+2,sectiony, xright,sectiony) - replacement in log_browser.lua at line 150
love.graphics.print(line.section_stack[i].name, x+State.font_height+5, App.screen.height-App.width(to_text(line.section_stack[i].name))-5, --[[vertically]] math.pi/2)love.graphics.print(line.section_stack[i].name, x+State.font_height+5, App.screen.height-App.width(line.section_stack[i].name)-5, --[[vertically]] math.pi/2) - replacement in log_browser.lua at line 165
love.graphics.print(line.section_stack[i].name, x, App.screen.height-App.width(to_text(line.section_stack[i].name))-5, --[[vertically]] math.pi/2)love.graphics.print(line.section_stack[i].name, x, App.screen.height-App.width(line.section_stack[i].name)-5, --[[vertically]] math.pi/2) - file un-deletion: help.lua help.lua
- resurrect zombie in help.lua at line 1
return App.width('* ') - edit in help.lua at line 1
function draw_help_without_mouse_pressed(State, drawing_index)local drawing = State.lines[drawing_index]local line_cache = State.line_cache[drawing_index]App.color(Help_color)local y = line_cache.starty+10love.graphics.print("Things you can do:", State.left+30,y)y = y + State.line_heightlove.graphics.print("* Press the mouse button to start drawing a "..current_shape(State), State.left+30,y)y = y + State.line_heightlove.graphics.print("* Hover on a point and press 'ctrl+u' to pick it up and start moving it,", State.left+30,y)y = y + State.line_heightlove.graphics.print("then press the mouse button to drop it", State.left+30+bullet_indent(),y)y = y + State.line_heightlove.graphics.print("* Hover on a point and press 'ctrl+n', type a name, then press 'enter'", State.left+30,y)y = y + State.line_heightlove.graphics.print("* Hover on a point or shape and press 'ctrl+d' to delete it", State.left+30,y)y = y + State.line_heightif State.current_drawing_mode ~= 'freehand' thenlove.graphics.print("* Press 'ctrl+p' to switch to drawing freehand strokes", State.left+30,y)y = y + State.line_heightendif State.current_drawing_mode ~= 'line' thenlove.graphics.print("* Press 'ctrl+l' to switch to drawing lines", State.left+30,y)y = y + State.line_heightendif State.current_drawing_mode ~= 'manhattan' thenlove.graphics.print("* Press 'ctrl+m' to switch to drawing horizontal/vertical lines", State.left+30,y)y = y + State.line_heightendif State.current_drawing_mode ~= 'circle' thenlove.graphics.print("* Press 'ctrl+o' to switch to drawing circles/arcs", State.left+30,y)y = y + State.line_heightendif State.current_drawing_mode ~= 'polygon' thenlove.graphics.print("* Press 'ctrl+g' to switch to drawing polygons", State.left+30,y)y = y + State.line_heightendif State.current_drawing_mode ~= 'rectangle' thenlove.graphics.print("* Press 'ctrl+r' to switch to drawing rectangles", State.left+30,y)y = y + State.line_heightendif State.current_drawing_mode ~= 'square' thenlove.graphics.print("* Press 'ctrl+s' to switch to drawing squares", State.left+30,y)y = y + State.line_heightendlove.graphics.print("* Press 'ctrl+=' or 'ctrl+-' to zoom in or out, ctrl+0 to reset zoom", State.left+30,y)y = y + State.line_heightlove.graphics.print("Press 'esc' now to hide this message", State.left+30,y)y = y + State.line_heightApp.color(Help_background_color)love.graphics.rectangle('fill', State.left,line_cache.starty, State.width, math.max(Drawing.pixels(drawing.h, State.width),y-line_cache.starty))endfunction draw_help_with_mouse_pressed(State, drawing_index)local drawing = State.lines[drawing_index]local line_cache = State.line_cache[drawing_index]App.color(Help_color)local y = line_cache.starty+10love.graphics.print("You're currently drawing a "..current_shape(State, drawing.pending), State.left+30,y)y = y + State.line_heightlove.graphics.print('Things you can do now:', State.left+30,y)y = y + State.line_heightif State.current_drawing_mode == 'freehand' thenlove.graphics.print('* Release the mouse button to finish drawing the stroke', State.left+30,y)y = y + State.line_heightelseif State.current_drawing_mode == 'line' or State.current_drawing_mode == 'manhattan' thenlove.graphics.print('* Release the mouse button to finish drawing the line', State.left+30,y)y = y + State.line_heightelseif State.current_drawing_mode == 'circle' thenif drawing.pending.mode == 'circle' thenlove.graphics.print('* Release the mouse button to finish drawing the circle', State.left+30,y)y = y + State.line_heightlove.graphics.print("* Press 'a' to draw just an arc of a circle", State.left+30,y)elselove.graphics.print('* Release the mouse button to finish drawing the arc', State.left+30,y)endy = y + State.line_heightelseif State.current_drawing_mode == 'polygon' thenlove.graphics.print('* Release the mouse button to finish drawing the polygon', State.left+30,y)y = y + State.line_heightlove.graphics.print("* Press 'p' to add a vertex to the polygon", State.left+30,y)y = y + State.line_heightelseif State.current_drawing_mode == 'rectangle' thenif #drawing.pending.vertices < 2 thenlove.graphics.print("* Press 'p' to add a vertex to the rectangle", State.left+30,y)y = y + State.line_heightelselove.graphics.print('* Release the mouse button to finish drawing the rectangle', State.left+30,y)y = y + State.line_heightlove.graphics.print("* Press 'p' to replace the second vertex of the rectangle", State.left+30,y)y = y + State.line_heightendelseif State.current_drawing_mode == 'square' thenif #drawing.pending.vertices < 2 thenlove.graphics.print("* Press 'p' to add a vertex to the square", State.left+30,y)y = y + State.line_heightelselove.graphics.print('* Release the mouse button to finish drawing the square', State.left+30,y)y = y + State.line_heightlove.graphics.print("* Press 'p' to replace the second vertex of the square", State.left+30,y)y = y + State.line_heightendendlove.graphics.print("* Press 'esc' then release the mouse button to cancel the current shape", State.left+30,y)y = y + State.line_heighty = y + State.line_heightif State.current_drawing_mode ~= 'line' thenlove.graphics.print("* Press 'l' to switch to drawing lines", State.left+30,y)y = y + State.line_heightendif State.current_drawing_mode ~= 'manhattan' thenlove.graphics.print("* Press 'm' to switch to drawing horizontal/vertical lines", State.left+30,y)y = y + State.line_heightendif State.current_drawing_mode ~= 'circle' thenlove.graphics.print("* Press 'o' to switch to drawing circles/arcs", State.left+30,y)y = y + State.line_heightendif State.current_drawing_mode ~= 'polygon' thenlove.graphics.print("* Press 'g' to switch to drawing polygons", State.left+30,y)y = y + State.line_heightendif State.current_drawing_mode ~= 'rectangle' thenlove.graphics.print("* Press 'r' to switch to drawing rectangles", State.left+30,y)y = y + State.line_heightendif State.current_drawing_mode ~= 'square' thenlove.graphics.print("* Press 's' to switch to drawing squares", State.left+30,y)y = y + State.line_heightendApp.color(Help_background_color)love.graphics.rectangle('fill', State.left,line_cache.starty, State.width, math.max(Drawing.pixels(drawing.h, State.width),y-line_cache.starty))endfunction current_shape(State, shape)if State.current_drawing_mode == 'freehand' thenreturn 'freehand stroke'elseif State.current_drawing_mode == 'line' thenreturn 'straight line'elseif State.current_drawing_mode == 'manhattan' thenreturn 'horizontal/vertical line'elseif State.current_drawing_mode == 'circle' and shape and shape.start_angle thenreturn 'arc'elsereturn State.current_drawing_modeendendfunction bullet_indent() - edit in help.lua at line 151[10.857]
end - replacement in drawing.lua at line 63
local name_text-- TODO: avoid computing name width on every repaintlocal name_width - replacement in drawing.lua at line 65
name_text = State.emname_width = App.width('m') - replacement in drawing.lua at line 67
name_text = App.newText(love.graphics.getFont(), p.name)name_width = App.width(p.name) - replacement in drawing.lua at line 69
love.graphics.rectangle('fill', x,y, App.width(name_text), State.line_height)love.graphics.rectangle('fill', x,y, name_width, State.line_height) - edit in drawing.lua at line 129[10.1244]→[10.1027:1054](∅→∅),[10.1244]→[10.1027:1054](∅→∅),[10.404]→[10.1055:1095](∅→∅),[10.404]→[10.1055:1095](∅→∅),[10.503]→[10.1096:1139](∅→∅),[10.503]→[10.1096:1139](∅→∅),[10.596]→[10.1140:1218](∅→∅),[10.596]→[10.1140:1218](∅→∅)
local name_widthname_width = App.width('m')name_width = App.width(p.name)love.graphics.rectangle('fill', x,y, name_width, State.line_height) - resolve order conflict in drawing.lua at line 129
- replacement in commands.lua at line 46
local s_text = to_text(s)local width = App.width(s_text)local width = App.width(s) - replacement in commands.lua at line 51
App.screen.draw(s_text, Menu_cursor,5)App.screen.print(s, Menu_cursor,5) - replacement in commands.lua at line 57
local filter_text = to_text(File_navigation.filter)App.screen.draw(filter_text, 5, 5)draw_cursor(5 + App.width(filter_text), 5)App.screen.print(File_navigation.filter, 5, 5)draw_cursor(5 + App.width(File_navigation.filter), 5) - replacement in commands.lua at line 98
local width = App.width(to_text(filename))local width = App.width(filename) - replacement in commands.lua at line 110
local s_text = to_text(s)local width = App.width(s_text)local width = App.width(s) - replacement in commands.lua at line 125
App.screen.draw(s_text, x,y)App.screen.print(s, x,y) - replacement in commands.lua at line 189
local filename_text = to_text(filename)width = App.width(filename_text)width = App.width(filename) - replacement in commands.lua at line 206
local filename_text = to_text(filename)width = App.width(filename_text)width = App.width(filename) - replacement in commands.lua at line 217
App.screen.draw(filename_text, x + x3-menu_xmin, y3)App.screen.print(filename, x + x3-menu_xmin, y3) - replacement in commands.lua at line 244
local width = App.width(to_text(filename))local width = App.width(filename) - replacement in commands.lua at line 262
local width = App.width(to_text(filename))local width = App.width(filename) - replacement in app.lua at line 140
error('There were test failures:\n\n'..table.concat(Test_errors))error(('There were %d test failures:\n\n%s'):format(#Test_errors, table.concat(Test_errors))) - edit in app.lua at line 147
error(('There were %d test failures:\n\n%s'):format(#Test_errors, table.concat(Test_errors))) - resolve order conflict in app.lua at line 147