I'm not sure why I thought it was necessary to put it in there.
The only difference in behavior from this commit: selecting text and hitting 'f4' used to delete the selected text before submitting. Now it no longer deletes. I've never relied on this.
'f4' needs no viewport book-keeping or A/B refreshing, so this should also be slightly less wasteful.
5HBC66CSFQ257TO3DJYBUNKE5RKR47CUJNMYP6Y4F7T6W7LNRV4AC
HH4SCTF3FG2ZD26MHBY7OGWFLJOYSKYIALIBNXT5OMRQGHWCZVQAC
YQOGOCZDEBZUJ36MFQF7VCYYXKI74WEV3YD5PUCNJSPDQGKXTWIQC
GZIHFEY3GJSSAVG7ICO6EHLMKZNL72425ADFIAPRATPPSZAOWHUAC
P4763IPDNYZAEV47U3ZDJ3CGMKKGUACABKBFPGNNIJSHQ7RAAP4AC
7TQAF4BYIK75EEYCCK7VEUSZHNCWMWIA3HZGQKIILYESUZ5ZZRVQC
2L5MEZV344TOZLVY3432RHJFIRVXFD6O3GWLL5O4CV66BGAFTURQC
XBOQIWITIRSZWIS2UKUFR6L45GLKTIZAXY4SEBS2OWBF6Q5CHRBQC
2JZZ7BDCWN37RJCEOJZQGCVNPWBS2IPQI5VEALMFLCMN4HLGC5DQC
P6MGPZQVKLKELXN5SKFHTEWSUMFUCQGRGHZQZEL2GH5IXUOJ4T7AC
TGAAKKGGQZ6V6V25DGVHDXUXR74OYGG7RGRXVWKASDCONXZ63LYAC
R5QXEHUIZLELJGGCZAE7ATNS3CLRJ7JFRENMGH4XXH24C5WABZDQC
BF7TW3EKRIDYC6J2Q2J4YOBAVQF55Y3H6KGZIHNXMH4N72MR6GXQC
-- repl
if chord == 'f4' then
State.load_time_error = nil
live.send_definition_to_app(State)
while true do
local response_string = live.receive_from_app()
if response_string then
Client_app_test_failures = json.decode(response_string)
break
end
if live.receive_run_time_error_from_app() then
break
end
love.timer.sleep(0.001)
end
if Load_time_error then
State.load_time_error = Load_time_error
Load_time_error = nil
end
if on.code_submit then on.code_submit(State) end
submit_definition = function(State)
State.load_time_error = nil
live.send_definition_to_app(State)
while true do
local response_string = live.receive_from_app()
if response_string then
Client_app_test_failures = json.decode(response_string)
break
end
if live.receive_run_time_error_from_app() then
break
end
love.timer.sleep(0.001)
end
if Load_time_error then
State.load_time_error = Load_time_error
Load_time_error = nil
end
if on.code_submit then on.code_submit(State) end
end
local old_top = {line=Cursor_node.editor.screen_top1.line, pos=Cursor_node.editor.screen_top1.pos}
local old_definition_name = live.get_cmd_from_buffer(Cursor_node.editor.lines[1].data)
edit.keychord_press(Cursor_node.editor, chord, key)
if not eq(Cursor_node.editor.screen_top1, old_top) then
Viewport.y = Cursor_node.y + y_of_schema1(Cursor_node.editor, Cursor_node.editor.screen_top1)
end
local definition_name = live.get_cmd_from_buffer(Cursor_node.editor.lines[1].data)
maybe_update_key_in_definitions(old_definition_name, definition_name, Cursor_node)
if chord == 'return' then
A(--[[preserve screen_top of cursor node]] true)
if chord == 'f4' then
submit_definition(Cursor_node.editor)
B(--[[preserve screen_top of cursor node]] true)
local old_top = {line=Cursor_node.editor.screen_top1.line, pos=Cursor_node.editor.screen_top1.pos}
local old_definition_name = live.get_cmd_from_buffer(Cursor_node.editor.lines[1].data)
edit.keychord_press(Cursor_node.editor, chord, key)
if not eq(Cursor_node.editor.screen_top1, old_top) then
Viewport.y = Cursor_node.y + y_of_schema1(Cursor_node.editor, Cursor_node.editor.screen_top1)
end
local definition_name = live.get_cmd_from_buffer(Cursor_node.editor.lines[1].data)
maybe_update_key_in_definitions(old_definition_name, definition_name, Cursor_node)
if chord == 'return' then
A(--[[preserve screen_top of cursor node]] true)
else
B(--[[preserve screen_top of cursor node]] true)
end