on.mouse_press = function(x,y, mouse_button, is_touch, presses) for _,editor in ipairs(Editors) do editor.selection1 = {} end for i,editor in ipairs(Editors) do if x >= editor.left and x <= editor.right then Cursor_editor = editor edit.mouse_press(editor, x,y, mouse_button, is_touch, presses) break end end end