add state arg to a few functions
[?]
Jul 13, 2022, 12:02 AM
5ZA3BRNYWKSGEBJ4JLA4UBC3LJPT5JBWYCU7PQYRSGX6MJMEWDIQCDependencies
- [2]
LNUHQOGHstart passing in Editor_state explicitly - [3]
LF7BWEG4group all editor globals - [4]
LXTTOB33extract a couple of files - [5]
4KC7I3E2make colors easier to edit - [6]
2L5MEZV3experiment: new edit namespace
Change contents
- replacement in search.lua at line 24
function Text.search_next()function Text.search_next(State) - replacement in search.lua at line 26
local pos = Editor_state.lines[Editor_state.cursor1.line].data:find(Editor_state.search_term, Editor_state.cursor1.pos)local pos = State.lines[State.cursor1.line].data:find(State.search_term, State.cursor1.pos) - replacement in search.lua at line 28
Editor_state.cursor1.pos = posState.cursor1.pos = pos - replacement in search.lua at line 31
for i=Editor_state.cursor1.line+1,#Editor_state.lines dopos = Editor_state.lines[i].data:find(Editor_state.search_term)for i=State.cursor1.line+1,#State.lines dopos = State.lines[i].data:find(State.search_term) - replacement in search.lua at line 34
Editor_state.cursor1.line = iEditor_state.cursor1.pos = posState.cursor1.line = iState.cursor1.pos = pos - replacement in search.lua at line 42
for i=1,Editor_state.cursor1.line-1 dopos = Editor_state.lines[i].data:find(Editor_state.search_term)for i=1,State.cursor1.line-1 dopos = State.lines[i].data:find(State.search_term) - replacement in search.lua at line 45
Editor_state.cursor1.line = iEditor_state.cursor1.pos = posState.cursor1.line = iState.cursor1.pos = pos - replacement in search.lua at line 52
Editor_state.cursor1.line = Editor_state.search_backup.cursor.lineEditor_state.cursor1.pos = Editor_state.search_backup.cursor.posEditor_state.screen_top1.line = Editor_state.search_backup.screen_top.lineEditor_state.screen_top1.pos = Editor_state.search_backup.screen_top.posState.cursor1.line = State.search_backup.cursor.lineState.cursor1.pos = State.search_backup.cursor.posState.screen_top1.line = State.search_backup.screen_top.lineState.screen_top1.pos = State.search_backup.screen_top.pos - replacement in search.lua at line 57
if Text.lt1(Editor_state.cursor1, Editor_state.screen_top1) or Text.lt1(Editor_state.screen_bottom1, Editor_state.cursor1) thenEditor_state.screen_top1.line = Editor_state.cursor1.linelocal _, pos = Text.pos_at_start_of_cursor_screen_line(Editor_state.margin_left, App.screen.width-Editor_state.margin_right)Editor_state.screen_top1.pos = posif Text.lt1(State.cursor1, State.screen_top1) or Text.lt1(State.screen_bottom1, State.cursor1) thenState.screen_top1.line = State.cursor1.linelocal _, pos = Text.pos_at_start_of_cursor_screen_line(State, State.margin_left, App.screen.width-State.margin_right)State.screen_top1.pos = pos - replacement in search.lua at line 64
function Text.search_previous()function Text.search_previous(State) - replacement in search.lua at line 66
local pos = rfind(Editor_state.lines[Editor_state.cursor1.line].data, Editor_state.search_term, Editor_state.cursor1.pos)local pos = rfind(State.lines[State.cursor1.line].data, State.search_term, State.cursor1.pos) - replacement in search.lua at line 68
Editor_state.cursor1.pos = posState.cursor1.pos = pos - replacement in search.lua at line 71
for i=Editor_state.cursor1.line-1,1,-1 dopos = rfind(Editor_state.lines[i].data, Editor_state.search_term)for i=State.cursor1.line-1,1,-1 dopos = rfind(State.lines[i].data, State.search_term) - replacement in search.lua at line 74
Editor_state.cursor1.line = iEditor_state.cursor1.pos = posState.cursor1.line = iState.cursor1.pos = pos - replacement in search.lua at line 82
for i=#Editor_state.lines,Editor_state.cursor1.line+1,-1 dopos = rfind(Editor_state.lines[i].data, Editor_state.search_term)for i=#State.lines,State.cursor1.line+1,-1 dopos = rfind(State.lines[i].data, State.search_term) - replacement in search.lua at line 85
Editor_state.cursor1.line = iEditor_state.cursor1.pos = posState.cursor1.line = iState.cursor1.pos = pos - replacement in search.lua at line 92
Editor_state.cursor1.line = Editor_state.search_backup.cursor.lineEditor_state.cursor1.pos = Editor_state.search_backup.cursor.posEditor_state.screen_top1.line = Editor_state.search_backup.screen_top.lineEditor_state.screen_top1.pos = Editor_state.search_backup.screen_top.posState.cursor1.line = State.search_backup.cursor.lineState.cursor1.pos = State.search_backup.cursor.posState.screen_top1.line = State.search_backup.screen_top.lineState.screen_top1.pos = State.search_backup.screen_top.pos - replacement in search.lua at line 97
if Text.lt1(Editor_state.cursor1, Editor_state.screen_top1) or Text.lt1(Editor_state.screen_bottom1, Editor_state.cursor1) thenEditor_state.screen_top1.line = Editor_state.cursor1.linelocal _, pos = Text.pos_at_start_of_cursor_screen_line(Editor_state.margin_left, App.screen.width-Editor_state.margin_right)Editor_state.screen_top1.pos = posif Text.lt1(State.cursor1, State.screen_top1) or Text.lt1(State.screen_bottom1, State.cursor1) thenState.screen_top1.line = State.cursor1.linelocal _, pos = Text.pos_at_start_of_cursor_screen_line(State, State.margin_left, App.screen.width-State.margin_right)State.screen_top1.pos = pos - replacement in edit.lua at line 282
Text.search_next()Text.search_next(State) - replacement in edit.lua at line 323
Text.search_next()Text.search_next(State) - replacement in edit.lua at line 325
Text.search_previous()Text.search_previous(State)