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]
if l.mode ~= 'text' then return false end -- pos is irrelevant to validity for a drawing line
return loc1.pos > #State.lines[loc1.line].data
--? print('text input', t)
if State.search_term then
State.search_term = State.search_term..t
State.search_text = nil
--? print('press', State.cursor1.line)
for line_index,line in ipairs(State.lines) do
if Text.in_line(State, line_index, x,y) then
--? print('reset selection')
State.cursor1 = {
line=line_index,
pos=Text.to_pos_on_line(State, line_index, x, y),
}
--? print('cursor', State.cursor1.line, State.cursor1.pos)
if State.mousepress_shift then
if State.old_selection1.line == nil then
State.selection1 = State.old_cursor1
else
State.selection1 = State.old_selection1
end
end
--? print('release', State.cursor1.line)
if mouse_press_consumed_by_any_button_handler(State, x,y, mouse_button) then
else
end
function edit.cursor_on_text(State)
return State.cursor1.line <= #State.lines
and State.lines[State.cursor1.line].mode == 'text'
end
function test_move_point()
-- create a drawing with a line
App.screen.init{width=Test_margin_left+256, height=300} -- drawing coordinates 1:1 with pixels
Editor_state = edit.initialize_test_state()
Editor_state.filename = 'foo'
Editor_state.lines = load_array{'```lines', '```', ''}
Text.redraw_all(Editor_state)
Editor_state.current_drawing_mode = 'line'
edit.draw(Editor_state)
edit.run_after_mouse_press(Editor_state, Editor_state.left+5, Editor_state.top+Drawing_padding_top+6, 1)
edit.run_after_mouse_release(Editor_state, Editor_state.left+35, Editor_state.top+Drawing_padding_top+36, 1)
local drawing = Editor_state.lines[1]