up arrow to search previous
[?]
Jun 3, 2022, 2:48 PM
TKFSYQ2ZTEPN27IGKGEYSUS7FQ2AUIC7DJWFF2RJ53AW6QRPMXWQCDependencies
- [2]
Z4XRNDTRfind text - [*]
BULPIBEGbeginnings of a module for the text editor - [*]
DHI6IJCNselecting text and deleting selections - [*]
OTIBCAUJlove2d scaffold
Change contents
- edit in text.lua at line 148
if pos thenCursor1.line = iCursor1.pos = posbreakendendendif pos == nil thenCursor1.line = Search_backup_cursor1.lineCursor1.pos = Search_backup_cursor1.posendif Text.lt1(Cursor1, Screen_top1) or Text.lt1(Screen_bottom1, Cursor1) thenScreen_top1.line = Cursor1.linelocal _, pos = Text.pos_at_start_of_cursor_screen_line()Screen_top1.pos = posendendfunction Text.search_previous()-- search current linelocal pos = rfind(Lines[Cursor1.line].data, Search_term, Cursor1.pos)if pos thenCursor1.pos = posendif pos == nil thenfor i=Cursor1.line-1,1,-1 dopos = rfind(Lines[i].data, Search_term) - edit in text.lua at line 183
-- wrap aroundfor i=#Lines,Cursor1.line+1,-1 dopos = rfind(Lines[i].data, Search_term)if pos thenCursor1.line = iCursor1.pos = posbreakendendendif pos == nil then - edit in text.lua at line 204
function rfind(s, pat, i)local rs = s:reverse()local rpat = pat:reverse()if i == nil then i = #s endlocal ri = #s - i + 1local rendpos = rs:find(rpat, ri)if rendpos == nil then return nil endlocal endpos = #s - rendpos + 1assert (endpos >= #pat)return endpos-#pat+1end - edit in main.lua at line 258
elseif chord == 'up' thenText.search_previous()