Merge text0
[?]
Jul 31, 2023, 6:08 PM
52NEZG2FJSEHUOZI72O7VEHXULPUHKTC4FPP7HSY3CNGKR4OPCCQCDependencies
- [2]
2N3HLCOVMerge text0 - [3]
4L3UAM75experiment: knob for readonly editor - [4]
BMGHJX7Gbugfix: search highlight straddling screen lines - [5]
UBA2ZUCPremove a duplicate print to screen - [6]
GZ2OYPSHconfigurable colors and cursor in editor widget - [7]
TLEW46AQMerge text0 - [8]
PLKNHYZ4extract a function - [9]
B4FAIVRAMerge lines.love - [10]
HALS7E5Umore clearly skip prints before screen top - [11]
LSYLEVBDdrop some redundant args when clearing the cache - [12]
TGHAJBESuse line cache for drawings as well - [13]
R53OF3ONone bug I've repeatedly run into while testing with Moby Dick - [14]
6K5PFF6Xhelper: trimming whitespace from strings - [15]
ZPQI5UL3bugfix: never use utf8 pos in string.sub - [16]
NQM25OZVreduce use of rfind - [17]
IAWCZRFUextract a variable - [18]
CYEH4AXBa prefix for metadata in the manifest - [19]
KB7KTSCPMerge lines.love - [20]
MD3W5IRAnew fork: rip out drawing support - [21]
ILOA5BYFseparate data structure for each line's cache data - [22]
MUJTM6REbring back a level of wrapping - [23]
SDEY7LFJrename a variable - [24]
ZE7LVQNEimprove a comment - [25]
Z4XRNDTRfind text - [26]
4CTZOJPCstop pretending globals are local - [27]
HLIF3YQEMerge text0 - [28]
ZLJYLPOTMerge lines.love - [29]
FZBXBUFFbugfix: search - [30]
TWXPV2AChoist and duplicate a conditional - [31]
IM7UEBMKbugfix: highlight search patterns on the right line - [32]
I64IPGJXavoid saving fragments in lines - [*]
BULPIBEGbeginnings of a module for the text editor
Change contents
- edit in text.lua at line 37[5.458]→[2.3:237](∅→∅),[5.458]→[2.3:237](∅→∅),[2.237]→[5.26:172](∅→∅),[5.1893]→[5.26:172](∅→∅),[5.172]→[5.3604:3632](∅→∅),[5.1566]→[5.3604:3632](∅→∅),[5.3632]→[5.174:174](∅→∅),[5.3632]→[5.174:174](∅→∅),[5.174]→[5.888:961](∅→∅),[5.774]→[5.888:961](∅→∅),[5.774]→[5.888:961](∅→∅)
local 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 lo_px = Text.draw_highlight(State, line, State.left,y, pos, State.cursor1.pos, State.cursor1.pos+utf8.len(State.search_term))App.color(fg)love.graphics.print(State.search_term, State.left+lo_px,y) - resurrect zombie in text.lua at line 37[5.49]→[5.4:38](∅→∅),[5.49]→[5.4:38](∅→∅),[5.38]→[4.4:586](∅→∅),[5.38]→[4.4:586](∅→∅),[5.38]→[4.4:586](∅→∅)
if 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_selection - replacement in text.lua at line 46[5.854]→[3.4:157](∅→∅),[5.854]→[3.4:157](∅→∅),[3.157]→[5.6:6](∅→∅),[5.3671]→[5.6:6](∅→∅),[5.6]→[5.7:121](∅→∅)
elseif hide_cursor thenText.pretend_draw_cursor(State, State.left+Text.x(screen_line, State.cursor1.pos-pos+1), y)elseText.draw_cursor(State, State.left+Text.x(screen_line, State.cursor1.pos-pos+1), y, Cursor_color, fg)endelseif pos <= State.cursor1.pos and pos + frag_len > State.cursor1.pos thenif hide_cursor thenText.pretend_draw_cursor(State, State.left+Text.x(screen_line, State.cursor1.pos-pos+1), y)elseText.draw_cursor(State, State.left+Text.x(screen_line, State.cursor1.pos-pos+1), y, Cursor_color, fg)endelseif 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.if hide_cursor thenText.pretend_draw_cursor(State, State.left+Text.x(screen_line, State.cursor1.pos-pos+1), y)elseText.draw_cursor(State, State.left+Text.x(screen_line, State.cursor1.pos-pos+1), y, Cursor_color, fg)end - edit in text.lua at line 965[5.442]→[2.239:239](∅→∅),[4.586]→[5.122:149](∅→∅),[5.854]→[5.122:149](∅→∅),[5.854]→[5.122:149](∅→∅),[5.149]→[5.87:571](∅→∅),[5.149]→[5.87:571](∅→∅)
endelseif 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. - resolve order conflict in text.lua at line 965[5.442]