bugfix: search highlight straddling screen lines
[?]
Jul 31, 2023, 4:15 PM
BMGHJX7GIX535K2DU7ZT4EP2O6MYS7QVING22AAJABUY53K2PLFACDependencies
- [2]
IM7UEBMKbugfix: highlight search patterns on the right line - [3]
UBA2ZUCPremove a duplicate print to screen - [4]
IAWCZRFUextract a variable - [5]
Z4XRNDTRfind text - [6]
KKMFQDR4editing source code from within the app - [7]
TWXPV2AChoist and duplicate a conditional - [8]
ZPQI5UL3bugfix: never use utf8 pos in string.sub - [9]
GZ5WULJVswitch source side to new screen-line-based render - [10]
CQWVUCXZbugfix: syntax highlighting in source editor - [11]
ZE7LVQNEimprove a comment - [12]
SDEY7LFJrename a variable - [13]
I64IPGJXavoid saving fragments in lines - [14]
HALS7E5Umore clearly skip prints before screen top - [*]
BULPIBEGbeginnings of a module for the text editor
Change contents
- replacement in text.lua at line 33[4.38]→[2.4:86](∅→∅),[2.86]→[4.3:237](∅→∅),[4.121]→[4.3:237](∅→∅),[4.458]→[4.3:237](∅→∅),[4.237]→[4.4:75](∅→∅),[4.75]→[3.36:125](∅→∅),[3.125]→[4.838:854](∅→∅),[4.961]→[4.838:854](∅→∅),[4.838]→[4.838:854](∅→∅)
if pos <= State.cursor1.pos and pos + frag_len > State.cursor1.pos 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 hi = State.cursor1.pos+utf8.len(State.search_term)Text.draw_highlight(State, line, State.left,y, pos, State.cursor1.pos, hi)endlocal 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 source_text.lua at line 50[4.271]→[2.576:658](∅→∅),[4.354]→[4.242:476](∅→∅),[2.658]→[4.242:476](∅→∅),[4.88448]→[4.242:476](∅→∅),[4.476]→[4.183:254](∅→∅),[4.254]→[3.266:355](∅→∅),[3.355]→[4.88835:88851](∅→∅),[4.1760]→[4.88835:88851](∅→∅),[4.88835]→[4.88835:88851](∅→∅)
if pos <= State.cursor1.pos and pos + frag_len > State.cursor1.pos 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 hi = State.cursor1.pos+utf8.len(State.search_term)Text.draw_highlight(State, line, State.left,y, pos, State.cursor1.pos, hi)endlocal 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