bugfix: restart search on backspace
Dependencies
- [2]
2H76FV5Sbugfix: searching files containing unicode - [3]
IENTL2ITindent - [4]
NSM73TX3crap, fix some final changes in the source editor - [5]
CUFW4EJLreorganize app.lua and its comments - [6]
2L5MEZV3experiment: new edit namespace - [7]
2TCIWW6Zstop caching starty - [8]
KKMFQDR4editing source code from within the app - [9]
LF7BWEG4group all editor globals - [10]
IX5YTLSVstate validation in source editor as well - [11]
5ZA3BRNYadd state arg to a few functions - [12]
7VGDIPLCmore robust state validation - [13]
ZS5IYZH5stop caching screen_bottom1 - [14]
G54H3YG2get rid of all bifold text - [15]
NVSC4N4Kchange a helper slightly - [16]
T6A5SZGBbugfix: restart search on backspace - [17]
LNUHQOGHstart passing in Editor_state explicitly - [*]
LXTTOB33extract a couple of files - [*]
AMOPICKVbugfix: check after cursor on same line when searching upwards - [*]
3QNOKBFMbeginnings of a test harness
Change contents
- edit in text_tests.lua at line 2075
endfunction test_search_downwards_from_end_of_line()App.screen.init{width=120, height=60}Editor_state = edit.initialize_test_state()Editor_state.lines = load_array{'abc', 'def', 'ghi'}Text.redraw_all(Editor_state)Editor_state.cursor1 = {line=1, pos=4}Editor_state.screen_top1 = {line=1, pos=1}edit.draw(Editor_state)-- search for empty stringedit.run_after_keychord(Editor_state, 'C-f', 'f')edit.run_after_keychord(Editor_state, 'down', 'down')-- no crash - edit in source_text_tests.lua at line 2075
endfunction test_search_downwards_from_end_of_line()App.screen.init{width=120, height=60}Editor_state = edit.initialize_test_state()Editor_state.lines = load_array{'abc', 'def', 'ghi'}Text.redraw_all(Editor_state)Editor_state.cursor1 = {line=1, pos=4}Editor_state.screen_top1 = {line=1, pos=1}edit.draw(Editor_state)-- search for empty stringedit.run_after_keychord(Editor_state, 'C-f', 'f')edit.run_after_keychord(Editor_state, 'down', 'down')-- no crash - replacement in source_edit.lua at line 145
while true doif State.cursor1.line >= #State.lines thenlocal line = State.cursor1.linewhile line < #State.lines doline = line+1if State.lines[line].mode == 'text' thenState.cursor1.line = lineState.cursor1.pos = 1 - replacement in source_edit.lua at line 153
if State.lines[State.cursor1.line].mode == 'text' thenendendfunction edit.put_cursor_on_next_text_line_wrapping_around_if_necessary(State)local line = State.cursor1.linelocal max = #State.linesfor _ = 1, max-1 doline = (line+1) % maxif State.lines[line].mode == 'text' thenState.cursor1.line = lineState.cursor1.pos = 1 - replacement in source_edit.lua at line 166
State.cursor1.line = State.cursor1.line+1State.cursor1.pos = 1endendfunction edit.put_cursor_on_next_text_loc_wrapping_around_if_necessary(State)local cursor_line = State.lines[State.cursor1.line].dataif State.cursor1.pos <= utf8.len(cursor_line) thenState.cursor1.pos = State.cursor1.pos + 1elseedit.put_cursor_on_next_text_line_wrapping_around_if_necessary(State) - edit in source_edit.lua at line 431
State.cursor = deepcopy(State.search_backup.cursor)State.screen_top = deepcopy(State.search_backup.screen_top)Text.search_next(State) - replacement in source_edit.lua at line 435
State.cursor1.pos = State.cursor1.pos+1edit.put_cursor_on_next_text_loc_wrapping_around_if_necessary(State) - replacement in edit.lua at line 143
while true doif State.cursor1.line >= #State.lines thenlocal line = State.cursor1.linewhile line < #State.lines doline = line+1if State.lines[line].mode == 'text' thenState.cursor1.line = lineState.cursor1.pos = 1 - replacement in edit.lua at line 151
if State.lines[State.cursor1.line].mode == 'text' thenendendfunction edit.put_cursor_on_next_text_line_wrapping_around_if_necessary(State)local line = State.cursor1.linelocal max = #State.linesfor _ = 1, max-1 doline = (line+1) % maxif State.lines[line].mode == 'text' thenState.cursor1.line = lineState.cursor1.pos = 1 - replacement in edit.lua at line 164
State.cursor1.line = State.cursor1.line+1State.cursor1.pos = 1endendfunction edit.put_cursor_on_next_text_loc_wrapping_around_if_necessary(State)local cursor_line = State.lines[State.cursor1.line].dataif State.cursor1.pos <= utf8.len(cursor_line) thenState.cursor1.pos = State.cursor1.pos + 1elseedit.put_cursor_on_next_text_line_wrapping_around_if_necessary(State) - replacement in edit.lua at line 429
State.cursor1.pos = State.cursor1.pos+1edit.put_cursor_on_next_text_loc_wrapping_around_if_necessary(State) - replacement in app.lua at line 134
--? test_click_below_all_lines()--? test_search()