check_eq(Editor_state.cursor1.pos, 6, '1/cursor:pos')
end
Editor_state.lines = load_array{'abc ’abd'} -- contains unicode quote
Text.redraw_all(Editor_state)
Editor_state.cursor1 = {line=1, pos=1}
Editor_state.screen_top1 = {line=1, pos=1}
Editor_state.screen_bottom1 = {}
edit.draw(Editor_state)
-- search upwards for a string
edit.run_after_keychord(Editor_state, 'C-f')
check_eq(Editor_state.cursor1.pos, 2, '1/cursor:pos')
end
function test_search_wrap_upwards()
Editor_state.cursor1 = {line=2, pos=1}
Editor_state.screen_top1 = {line=1, pos=1}
Editor_state.screen_bottom1 = {}
edit.draw(Editor_state)
-- search for a string
edit.run_after_keychord(Editor_state, 'C-f')
Editor_state.lines = load_array{'’abc', 'def'} -- contains unicode quote in first line
Text.redraw_all(Editor_state)
check_eq(Editor_state.cursor1.pos, 2, '2/cursor:pos')
end
function test_search_wrap()
Editor_state.cursor1 = {line=2, pos=1}
Editor_state.screen_top1 = {line=1, pos=1}
Editor_state.screen_bottom1 = {}
edit.draw(Editor_state)
-- search for a string
edit.run_after_keychord(Editor_state, 'C-f')
Editor_state.lines = load_array{'’abc', 'abd'} -- contains unicode quote
Text.redraw_all(Editor_state)
check_eq(Editor_state.cursor1.pos, 2, '2/cursor:pos')
end
function test_search_upwards()
Editor_state.lines = load_array{'```lines', '```', 'def', 'ghi', '’deg'} -- contains unicode quote in final line
Text.redraw_all(Editor_state)
Editor_state.cursor1 = {line=1, pos=1}
Editor_state.screen_top1 = {line=1, pos=1}
Editor_state.screen_bottom1 = {}
edit.draw(Editor_state)
-- search for a string
edit.run_after_keychord(Editor_state, 'C-f')