more clearly skip prints before screen top
[?]
Jul 20, 2022, 1:53 PM
HALS7E5UGKCP3DFY456F7Z3Y6WNGIABOCV2SHT34D5ZAGNCPV5PQCDependencies
- [2]
MXA3RZYKdeduce left/right from state where possible - [3]
S2MISTTMadd state arg to a few functions - [4]
JY4VK7L2rename - [5]
RTDYYP4Hbugfix: text past cursor was rendered red on wrapped lines - [6]
LERERVPHkeep one screen line of overlap on pagedown - [7]
2ZRC7FUL. - [8]
3TFEAQSWstart using some globals - [9]
Z4XRNDTRfind text - [10]
4CXVIEBSadd args to some functions - [11]
4KC7I3E2make colors easier to edit - [12]
WLHI7KD3new globals: draw partial screen line up top - [13]
MGT5FTJ3first stab at supporting wrapping in cursor up - [14]
537TQ2QNsome more logging - [15]
LF7BWEG4group all editor globals - [16]
FHSZYAZ2more precise search highlighting - [17]
5DOTWNVMright margin - [18]
H2DPLWMVsnapshot: wrapping long lines at word boundaries - [19]
2RXZ3PGObeginning of a new approach to scroll+wrap - [20]
A2NV3WVOscrolling with up arrow - [21]
AYE2VEGJextract a couple of methods - [22]
XVR2O5PIchange text cursor shape - [23]
DHI6IJCNselecting text and deleting selections - [24]
OYXDYPGSget rid of debug variables - [25]
IMEJA43Lsnapshot - [26]
XNFTJHC4split keyboard handling between Text and Drawing - [27]
JRGTJ2IWquite the frustrating bugfix - [28]
5DOC2CBMextract a function - [29]
ESETRNLBbugfix: printing the first part of a line at the bottom made it seem non-wrapping - [30]
PR4KIAZDfirst stab at equally hacky cursor down support - [31]
ULKLJBN6couple of renames - [32]
HOSPP2ANcrisp font rendering - [33]
MDXGMZU2disable all debug prints - [34]
CVGE3SIGI feel confident now that page-down is working. - [35]
QYIFOHW3first test! - [36]
LAW2O3NWextract variable Margin_left - [37]
M6TH7VSZrip out notion of Line_width - [38]
BOFNXP5Gclicking now moves the cursor even on long, wrapped lines - [39]
GK47BBCYstart passing left/right margins everywhere - [40]
X3F7ECSLadd state arg to some functions - [*]
BULPIBEGbeginnings of a module for the text editor
Change contents
- replacement in text.lua at line 34[3.334]→[2.209:301](∅→∅),[2.301]→[3.1:74](∅→∅),[3.417]→[3.1:74](∅→∅),[3.2255]→[3.1:74](∅→∅),[3.2151]→[3.1:74](∅→∅),[3.74]→[3.335:405](∅→∅)
if x + frag_width > State.right thenassert(x > State.left) -- no overfull lines-- update y only after drawing the first screen line of screen topif Text.lt1(State.screen_top1, {line=line_index, pos=pos}) thenif Text.lt1({line=line_index, pos=pos}, State.screen_top1) then-- render nothing--? print('skipping', frag)elseif x + frag_width > State.right thenassert(x > State.left) -- no overfull lines - edit in text.lua at line 47
x = State.left - edit in text.lua at line 49[3.129]→[2.302:323](∅→∅),[3.179]→[3.2198:2206](∅→∅),[2.323]→[3.2198:2206](∅→∅),[3.433]→[3.2198:2206](∅→∅),[3.2278]→[3.2198:2206](∅→∅),[3.2198]→[3.2198:2206](∅→∅),[3.2206]→[3.498:560](∅→∅),[3.560]→[3.387:427](∅→∅),[3.705]→[3.387:427](∅→∅),[3.54650]→[3.387:427](∅→∅),[3.152]→[3.387:427](∅→∅),[3.427]→[3.561:629](∅→∅)
x = State.leftend--? print('checking to draw', pos, State.screen_top1.pos)-- don't draw text above screen topif Text.le1(State.screen_top1, {line=line_index, pos=pos}) then - replacement in text.lua at line 55[3.110]→[3.260:268](∅→∅),[3.334]→[3.260:268](∅→∅),[3.260]→[3.260:268](∅→∅),[3.268]→[3.2254:2288](∅→∅),[3.2254]→[3.2254:2288](∅→∅),[3.2288]→[3.666:1099](∅→∅),[3.1099]→[3.28:62](∅→∅),[3.55294]→[3.28:62](∅→∅),[3.113]→[3.28:62](∅→∅),[3.62]→[3.1100:1162](∅→∅)
end-- render cursor if necessaryif line_index == State.cursor1.line thenif pos <= State.cursor1.pos and pos + frag_len > State.cursor1.pos thenif State.search_term thenif State.lines[State.cursor1.line].data:sub(State.cursor1.pos, State.cursor1.pos+utf8.len(State.search_term)-1) == State.search_term thenlocal lo_px = Text.draw_highlight(line, x,y, pos, State.cursor1.pos, State.cursor1.pos+utf8.len(State.search_term))App.color(Text_color)love.graphics.print(State.search_term, x+lo_px,y)-- render cursor if necessaryif line_index == State.cursor1.line thenif pos <= State.cursor1.pos and pos + frag_len > State.cursor1.pos thenif State.search_term thenif State.lines[State.cursor1.line].data:sub(State.cursor1.pos, State.cursor1.pos+utf8.len(State.search_term)-1) == State.search_term thenlocal lo_px = Text.draw_highlight(line, x,y, pos, State.cursor1.pos, State.cursor1.pos+utf8.len(State.search_term))App.color(Text_color)love.graphics.print(State.search_term, x+lo_px,y)endelseText.draw_cursor(State, x+Text.x(frag, State.cursor1.pos-pos+1), y) - edit in text.lua at line 67
elseText.draw_cursor(State, x+Text.x(frag, State.cursor1.pos-pos+1), y) - edit in text.lua at line 69
x = x + frag_width - edit in text.lua at line 71
x = x + frag_width