Merge text.love
[?]
Jul 31, 2023, 5:59 PM
UGXRAL54A3U6IQMR4S32KTFIIA3PCJDYSOCP7IVTB2DATRKZS26QCDependencies
- [2]
X43ZIKR3Merge text.love - [3]
KWHC65JIMerge lines.love - [4]
KWIVKQQ7Merge lines.love - [5]
2L5MEZV3experiment: new edit namespace - [6]
VHQCNMARseveral more modules - [7]
Q6RXCILQMerge text.love - [8]
B6DS4GZCMerge lines.love - [9]
OGUV4HSAremove some memory leaks from rendered fragments - [10]
VXRYVZ74Merge text.love - [11]
VP5KC4XZMerge lines.love - [12]
2CFLXLIEMerge text.love - [13]
66X36NZNa little more prose describing manual_tests - [14]
XX7G2FFJintermingle freehand line drawings with text - [15]
LXTTOB33extract a couple of files - [16]
4SR3Z4Y3document the version of LÖVE I've been using - [17]
SGMA5JLEsave the list of tests in repo - [18]
D4B52CQ2Merge lines.love - [19]
4YDBYBA4clean up memory leak experiments - [20]
AVTNUQYRbasic test-enabled framework - [21]
BULPIBEGbeginnings of a module for the text editor - [22]
ORKN6EOBMerge lines.love - [23]
VHUNJHXBMerge lines.love - [24]
PJ5PQAQErecord support for multiple versions - [25]
BJ5X5O4Alet's prevent the text cursor from ever getting on a drawing - [26]
RSZD5A7Gforgot to add json.lua - [27]
3PSFWAILMerge lines.love - [28]
K74U4BAUMerge lines.love - [29]
JYZKEDDGMerge lines.love - [30]
D2GCFTTTclean up repl functionality - [31]
ZLJYLPOTMerge lines.love - [32]
ONHKBLLCMerge lines.love - [33]
JOPVPUSAediting source code from within the app - [34]
CBTPWFGMMerge text.love - [35]
FS2ITYYHrecord a known issue - [36]
T4FRZSYLdelete an ancient, unused file - [37]
KKMFQDR4editing source code from within the app - [38]
TVCPXAAUrename - [39]
36Z442IVback to commit 8123959e52f without code editing - [40]
VXORMHMEdelete experimental REPL - [41]
FM5LDKGTMerge text.love - [42]
QD4LOFQRMerge text.love - [43]
OTIBCAUJlove2d scaffold - [44]
3QNOKBFMbeginnings of a test harness - [45]
CE4LZV4Tdrop last couple of manual tests - [46]
RU4HIK43Merge lines.love - [47]
UAYCSFSKMerge text.love - [48]
K2X6G75Zstart writing some tests for drawings - [49]
BLWAYPKVextract a module - [50]
R5QXEHUIsomebody stop me - [51]
MD3W5IRAnew fork: rip out drawing support - [52]
2CTN2IEFMerge lines.love - [53]
4HR3G5ZDMerge text.love - [54]
LWPFEZBIMerge lines.love - [55]
2JLMNZZIMerge text.love - [56]
TLOAPLBJadd a license - [57]
KMSL74GAsupport selections in the source editor - [58]
73OCE2MCafter much struggle, a brute-force undo - [59]
2344TV56Merge lines.love - [60]
N2NUGNN4include a brief reference enabling many useful apps - [61]
6LJZN727handle chords - [62]
IGBTDA6YMerge text.love - [63]
JDZVBFEIMerge lines.love
Change contents
- file deletion: source_text.lua source_text.lua
if not hide_cursor and line_index == State.cursor1.line then-- render search highlight or cursorif State.search_term thenlocal data = State.lines[State.cursor1.line].datalocal cursor_offset = Text.offset(data, State.cursor1.pos)if data:sub(cursor_offset, cursor_offset+#State.search_term-1) == State.search_term thenlocal save_selection = State.selection1State.selection1 = {line=line_index, pos=State.cursor1.pos+utf8.len(State.search_term)}local lo, hi = Text.clip_selection(State, line_index, pos, pos+frag_len)Text.draw_highlight(State, line, State.left,y, pos, lo,hi)State.selection1 = save_selectionendelseif Focus == 'edit' thenif pos <= State.cursor1.pos and pos + frag_len > State.cursor1.pos thenText.draw_cursor(State, State.left+Text.x(screen_line, State.cursor1.pos-pos+1), y)elseif pos + frag_len == State.cursor1.pos then-- Show cursor at end of line.-- This place also catches end of wrapping screen lines. That doesn't seem worth distinguishing.-- It seems useful to see a cursor whether your eye is on the left or right margin.Text.draw_cursor(State, State.left+Text.x(screen_line, State.cursor1.pos-pos+1), y)endendend-- render colorized textlocal x = State.leftfor frag in screen_line:gmatch('%S*%s*') doselect_color(frag)App.screen.print(frag, x,y)x = x+App.width(frag)end-- render link decorationslocal s,e,filename = unpack(link_offsets)local lo, hi = Text.clip_wikiword_with_screen_line(line, line_cache, i, s, e)if lo thenbutton(State, 'link', {x=State.left+lo, y=y, w=hi-lo, h=State.line_height, color={1,1,1},icon = icon.hyperlink_decoration,onpress1 = function()if file_exists(filename) thensource.switch_to_file(filename)endend,})-- render any highlightsfor _,link_offsets in ipairs(line_cache.link_offsets) do