bugfix: check before cursor on same line
[?]
Aug 12, 2022, 3:09 AM
MSOQI3A5BC5PY2MZXZQAQ4EQDT4KICQJPN3YUZVDYTWXSPZWBLIACDependencies
- [2]
EETIR4GXbugfix: skip over drawings when searching - [3]
LF7BWEG4group all editor globals - [4]
LXTTOB33extract a couple of files - [5]
5ZA3BRNYadd state arg to a few functions - [*]
FZBXBUFFbugfix: search
Change contents
- edit in text_tests.lua at line 2048[7.1427]
function test_search_wrap()io.write('\ntest_search_wrap')App.screen.init{width=120, height=60}Editor_state = edit.initialize_test_state()Editor_state.lines = load_array{'abc'}Text.redraw_all(Editor_state)Editor_state.cursor1 = {line=1, pos=3}Editor_state.screen_top1 = {line=1, pos=1}Editor_state.screen_bottom1 = {}edit.draw(Editor_state)-- search for a stringedit.run_after_keychord(Editor_state, 'C-f')edit.run_after_textinput(Editor_state, 'a')edit.run_after_keychord(Editor_state, 'return')-- cursor wrapscheck_eq(Editor_state.cursor1.line, 1, 'F - test_search_wrap/1/cursor:line')check_eq(Editor_state.cursor1.pos, 1, 'F - test_search_wrap/1/cursor:pos')end - replacement in search.lua at line 24
-- search current line-- search current line from cursor - edit in search.lua at line 33
-- search lines below cursor - edit in search.lua at line 58
-- search current line until cursorlocal line = State.lines[State.cursor1.line]if line.mode == 'text' thenpos = line.data:find(State.search_term)if pos and pos < State.cursor1.pos thenState.cursor1.pos = posendendendif pos == nil then