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5KRRKRQXBAW5AC
TNH6UKPBHR6BASM7XUGFEL56ATQRQ7ZWXN44TLZZAKVCQQJFDGSQC
M2SRPSX6TJJEEKUT6C4OEEZQNTL2FJEHDVSPLRHLNPZ7CWJQHSAAC
TFM6F5ODCDCNZPYVB5NZMW6MUEDTDUQNTBLPOVBTJ3IH7KT3ETKQC
564RK5FW46AHODXU7LMSGA5LQND5SIFQTZMBFEKYEA3KGMED4JBAC
FXI74QCLOZ4BS7UVZ3U2PE3LOL7MX3FWGHZCTGH3DYFXGTXVVIRAC
KCDRLLAAANY5USQHWZ5QQDZDHJFJB6NS4WYZB3WE4AW4LPIV2RAAC
TFZGBU3H3UBP7P6BYBNUYVUKJRTRTDAAMM6JIRLQPYJVAAOY56IQC
JAQWV4O2FRTCUPUACFBKAQOMLNGFTMDTCUQ6A23N7HXI42QYC7MAC
YCWU4GJYJAUYPFHMZNSGSG66EB4SRJV7MKEOY54CGBL4ELEPB5BAC
EWQEFSZQN6JAJVENZMUKCUEB25GUE23U6DYSBNFNLB2NVUUDQ7ZQC
VDXOEDS757ISV5KM5AUFZDFH223CHQB4FK3TQOQ75CDDJAPLCFQQC
KEFZWDCOCLPTLSZJKRV4VYAHRITV5T33YKG2VGT332YAUCOBS3EAC
ICUW7F3XQLURK4LSNPH5E3NDEFSRHKATEUHH2UPFJTMHYR3ZJF3QC
2L5MEZV344TOZLVY3432RHJFIRVXFD6O3GWLL5O4CV66BGAFTURQC
ZMBPXIZ4KO5NJECJTP4GXFMWNROKNHVIPVEKVXFA73ON45XIBRWQC
5XA7TKWYAWE3HDBJ477RDOALCTDCOGF73WXYVCSFZCID3KDWEM2QC
LF7BWEG4DKQI7NMXMZC4LC2BE5PB42HK5PD6OYBNIDMAZBJASOKQC
R2ASHK5CEE3PTRLS37GP4PXJ7HIGJ6UD72KKBI57UDJI7VRROQGQC
local font = love.graphics.newFont(settings.font_height)
Editor_state = edit.initialize_state(Margin_top, Margin_left + Line_number_width*App.width('m'), right, font, settings.font_height, math.floor(settings.font_height*1.3))
local font = love.graphics.newFont(font_height)
Editor_state = edit.initialize_state(Margin_top, Margin_left + Line_number_width*App.width('m'), App.screen.width-Margin_right, font, font_height, math.floor(font_height*1.3))
Editor_state.filename = 'run.lua'
source.initialize_window_geometry()
Editor_state.filename = settings.filename
-- set up desired window dimensions and make window resizable
_, _, App.screen.flags = App.screen.size()
App.screen.flags.resizable = true
App.screen.width, App.screen.height = settings.width, settings.height
App.screen.resize(App.screen.width, App.screen.height, App.screen.flags)
local font = love.graphics.newFont(Settings.font_height)
Editor_state = edit.initialize_state(Margin_top, Margin_left, App.screen.width-Margin_right, font, Settings.font_height, math.floor(Settings.font_height*1.3))
local font = love.graphics.newFont(font_height)
Editor_state = edit.initialize_state(Margin_top, Margin_left, App.screen.width-Margin_right, font, font_height, math.floor(font_height*1.3))
Settings = run.settings()
end
run.initialize_window_geometry()
Editor_state.filename = Settings.filename
Editor_state.screen_top1 = Settings.screen_top
Editor_state.cursor1 = Settings.cursor
end
-- set up desired window dimensions and make window resizable
_, _, App.screen.flags = App.screen.size()
App.screen.flags.resizable = true
Log_browser_state = edit.initialize_state(Margin_top, Editor_state.right + Margin_right + Margin_left, (Editor_state.right+Margin_right)*2, Editor_state.font, Editor_state.font_height, Editor_state.line_height)
Log_browser_state.filename = 'log'
load_from_disk(Log_browser_state) -- TODO: pay no attention to Fold
log_browser.parse(Log_browser_state)
Text.redraw_all(Log_browser_state)
Log_browser_state.screen_top1 = {line=1, pos=1}
Editor_state = edit.initialize_state(Margin_top, Margin_left + Line_number_width*App.width('m'), right, settings.font_height, math.floor(settings.font_height*1.3))
Editor_state = edit.initialize_state(Margin_top, Margin_left + Line_number_width*App.width('m'), right, font, settings.font_height, math.floor(settings.font_height*1.3))
Editor_state = edit.initialize_state(Margin_top, Margin_left + Line_number_width*App.width('m'), App.screen.width-Margin_right)
Editor_state = edit.initialize_state(Margin_top, Margin_left + Line_number_width*App.width('m'), App.screen.width-Margin_right, font, font_height, math.floor(font_height*1.3))
Log_browser_state = edit.initialize_state(Margin_top, Editor_state.right + Margin_right + Margin_left, (Editor_state.right+Margin_right)*2, Editor_state.font_height, Editor_state.line_height)
Log_browser_state = edit.initialize_state(Margin_top, Editor_state.right + Margin_right + Margin_left, (Editor_state.right+Margin_right)*2, Editor_state.font, Editor_state.font_height, Editor_state.line_height)
function edit.initialize_state(top, left, right, font_height, line_height) -- currently always draws to bottom of screen
function edit.initialize_state(top, left, right, font, font_height, line_height) -- currently always draws to bottom of screen
function edit.initialize_state(top, left, right, font, font_height, line_height) -- currently always draws to bottom of screen
font = font,
end -- edit.initialize_state
State.line_height = math.floor(font_height*1.3)
end
--== some methods for tests
-- Insulate tests from some key globals so I don't have to change the vast
-- majority of tests when they're modified for the real app.
Test_margin_left = 25
Test_margin_right = 0
function edit.initialize_test_state()
-- if you change these values, tests will start failing
return edit.initialize_state(
15, -- top margin
Test_margin_left,
App.screen.width - Test_margin_right,
15) -- line height
end
-- all text_input events are also keypresses
-- TODO: handle chords of multiple keys
function edit.run_after_text_input(State, t)
edit.keychord_press(State, t)
edit.text_input(State, t)
edit.key_release(State, t)
App.screen.contents = {}
edit.update(State, 0)
edit.draw(State)
end
-- not all keys are text_input
function edit.run_after_keychord(State, chord)
edit.keychord_press(State, chord)
edit.key_release(State, chord)
App.screen.contents = {}
edit.update(State, 0)
edit.draw(State)
end
function edit.run_after_mouse_click(State, x,y, mouse_button)
App.fake_mouse_press(x,y, mouse_button)
edit.mouse_press(State, x,y, mouse_button)
App.fake_mouse_release(x,y, mouse_button)
edit.mouse_release(State, x,y, mouse_button)
App.screen.contents = {}
edit.update(State, 0)
edit.draw(State)
end
function edit.run_after_mouse_press(State, x,y, mouse_button)
App.fake_mouse_press(x,y, mouse_button)
edit.mouse_press(State, x,y, mouse_button)
App.screen.contents = {}
edit.update(State, 0)
edit.draw(State)
end
function edit.run_after_mouse_release(State, x,y, mouse_button)
App.fake_mouse_release(x,y, mouse_button)
edit.mouse_release(State, x,y, mouse_button)
App.screen.contents = {}
edit.update(State, 0)
edit.draw(State)
end