We're soon going to start juggling multiple of these.
VAVXKWZVOFJGWHCWYLTPDKSKKMSJEBKXNKXUW3T6IZAC3HE6HOIQC 6RYGW5H3J44O73WFXGFVTBW5N5UEQ4E732AJJUZNBVQLYDA5LGLAC Z5M23NTKKGEACSQJT27DRNS7NEK6OSLR2IOWVAH2C2PRAIU46BIQC R5QXEHUIZLELJGGCZAE7ATNS3CLRJ7JFRENMGH4XXH24C5WABZDQC WR2WMEPEKNFAB4CAUBVFBACAJJSX2VX5B2VHKKSNTJSJBIIXFVZQC ZM7NOBRMD5HHA35Y4JDC76EOA2RD4KQOQCPURXYKXA6ABMKOJIGQC PRE6XPRNICDCHMF7C45A6DRPVT47IPAIWW6Q7AHNGW3D2PBGOPNAC VEAVIL4X64VGFCIKDQQTPGS2NSEX77VTSSZIJQMFH65D3EQMX7UAC 5RUFNRJOK3PXQKJTPDEN5K5PI67MGB25QUA44WOCCH2O5KHXT45QC TEDSEOCWSHACRYLLQJHAR4ZT6T5FUOQWUWPDI2WIIPHHKCG5OHPAC IP4LD33DQFWQ4654YPNJRKQ3CNYSHRZPX6U6ZPY7OLE744XX3MEQC MZ3DMYPD4LSSQKEA3GNI5MK2QNTJ523DTNG6DUPWEWLH4FLUIQSAC ICS45BILRVYLF7ADAON2W67YHOCRQVKMR6AMTLTJJHW7RIYIUP3AC UEG224LHBOPWSKOVXTKVAUEL47HET566LJF7ZSWVKMMLBSJWUHFAC Global_state = {}
Current_pane = {canvas = nil,editor_state = nil,output_editor_state = nil,}
Editor_state.top = Menu_bottom + 20Editor_state.left = Menu_left + 50 + Line_number_paddingEditor_state.right = math.min(100+30*App.width('m'), Safe_width*2/3)Editor_state.width = Editor_state.right - Editor_state.leftedit.update_font_settings(Editor_state, font_height)Text.redraw_all(Editor_state)
Current_pane.editor_state.top = Menu_bottom + 20Current_pane.editor_state.left = Menu_left + 50 + Line_number_paddingCurrent_pane.editor_state.right = math.min(100+30*App.width('m'), Safe_width*2/3)Current_pane.editor_state.width = Current_pane.editor_state.right - Current_pane.editor_state.leftedit.update_font_settings(Current_pane.editor_state, font_height)Text.redraw_all(Current_pane.editor_state)
Editor_state.right = math.min(100+30*App.width('m'), Safe_width*2/3)Editor_state.width = Editor_state.right - Editor_state.leftEditor_state.bottom = Safe_height/2-5Text.redraw_all(Editor_state)Output_editor_state.top = Editor_state.bottom+5+10+5Output_editor_state.right = Editor_state.rightOutput_editor_state.width = Editor_state.widthOutput_editor_state.bottom = Safe_height - 5
Current_pane.editor_state.right = math.min(100+30*App.width('m'), Safe_width*2/3)Current_pane.editor_state.width = Current_pane.editor_state.right - Current_pane.editor_state.leftCurrent_pane.editor_state.bottom = Safe_height/2-5Text.redraw_all(Current_pane.editor_state)Current_pane.output_editor_state.top = Current_pane.editor_state.bottom+5+10+5Current_pane.output_editor_state.right = Current_pane.editor_state.rightCurrent_pane.output_editor_state.width = Current_pane.editor_state.widthCurrent_pane.output_editor_state.bottom = Safe_height - 5
local x1 = Editor_state.left-5-Line_number_paddinglocal x2 = Editor_state.right+5local y1 = Editor_state.bottom+5+10
local x1 = Current_pane.editor_state.left-5-Line_number_paddinglocal x2 = Current_pane.editor_state.right+5local y1 = Current_pane.editor_state.bottom+5+10
local buf = table.concat(map(Editor_state.lines, function(line) return line.data end), '\n')Canvas = love.graphics.newCanvas()love.graphics.setCanvas(Canvas)
local buf = table.concat(map(Current_pane.editor_state.lines, function(line) return line.data end), '\n')Current_pane.canvas = love.graphics.newCanvas()love.graphics.setCanvas(Current_pane.canvas)
local x1 = Editor_state.left-5-Line_number_paddinglocal y1 = Editor_state.top-5local x2 = Editor_state.right+5local y2 = Editor_state.bottom+5
local x1 = Current_pane.editor_state.left-5-Line_number_paddinglocal y1 = Current_pane.editor_state.top-5local x2 = Current_pane.editor_state.right+5local y2 = Current_pane.editor_state.bottom+5
if Editor_state.scrollbar_drag thenadjust_scrollbar(Editor_state, y)Editor_state.scrollbar_drag = nilelseif on_editor_scrollbar_area(Editor_state, x,y) thenadjust_scrollbar(Editor_state, y)elseif x < Editor_state.right + 15 - 5 and y < Editor_state.bottom + 5 + 10 - 5 thenedit.mouse_release(Editor_state, x,y, mouse_button)elseif Output_editor_state.scrollbar_drag thenadjust_scrollbar(Output_editor_state, y)elseif on_editor_scrollbar_area(Output_editor_state, x,y) thenadjust_scrollbar(Output_editor_state, y)
if Current_pane.editor_state.scrollbar_drag thenadjust_scrollbar(Current_pane.editor_state, y)Current_pane.editor_state.scrollbar_drag = nilelseif on_editor_scrollbar_area(Current_pane.editor_state, x,y) thenadjust_scrollbar(Current_pane.editor_state, y)elseif x < Current_pane.editor_state.right + 15 - 5 and y < Current_pane.editor_state.bottom + 5 + 10 - 5 thenedit.mouse_release(Current_pane.editor_state, x,y, mouse_button)elseif Current_pane.output_editor_state.scrollbar_drag thenadjust_scrollbar(Current_pane.output_editor_state, y)elseif on_editor_scrollbar_area(Current_pane.output_editor_state, x,y) thenadjust_scrollbar(Current_pane.output_editor_state, y)
if on_editor_scrollbar(Editor_state, x,y) thenEditor_state.scrollbar_drag = trueelseif on_editor_scrollbar_area(Editor_state, x,y) then
if on_editor_scrollbar(Current_pane.editor_state, x,y) thenCurrent_pane.editor_state.scrollbar_drag = trueelseif on_editor_scrollbar_area(Current_pane.editor_state, x,y) then
elseif x < Editor_state.right + 15 - 5 and y < Editor_state.bottom + 5 + 10 - 5 thenedit.mouse_press(Editor_state, x,y, mouse_button)elseif on_editor_scrollbar(Output_editor_state, x,y) thenOutput_editor_state.scrollbar_drag = trueelseif on_editor_scrollbar_area(Output_editor_state, x,y) then
elseif x < Current_pane.editor_state.right + 15 - 5 and y < Current_pane.editor_state.bottom + 5 + 10 - 5 thenedit.mouse_press(Current_pane.editor_state, x,y, mouse_button)elseif on_editor_scrollbar(Current_pane.output_editor_state, x,y) thenCurrent_pane.output_editor_state.scrollbar_drag = trueelseif on_editor_scrollbar_area(Current_pane.output_editor_state, x,y) then
Text.redraw_all(Editor_state)Output_editor_state = edit.initialize_state(Editor_state.bottom+5+10+5, -- top
Text.redraw_all(Current_pane.editor_state)Current_pane.output_editor_state = edit.initialize_state(Current_pane.editor_state.bottom+5+10+5, -- top
if Editor_state.scrollbar_drag thenadjust_scrollbar(Editor_state, App.mouse_y())elseif Output_editor_state.scrollbar_drag thenadjust_scrollbar(Output_editor_state, App.mouse_y())
if Current_pane.editor_state.scrollbar_drag thenadjust_scrollbar(Current_pane.editor_state, App.mouse_y())elseif Current_pane.output_editor_state.scrollbar_drag thenadjust_scrollbar(Current_pane.output_editor_state, App.mouse_y())