save to disk when leaving thread view
This commit is contained in:
parent
c06afaa207
commit
5cf3d9bc2c
|
@ -1,6 +1,7 @@
|
|||
on.keychord_press = function(chord, key)
|
||||
print('key', chord)
|
||||
if Global_state.thread and chord == 'C-o' then
|
||||
quit_all_editors(Global_state.thread)
|
||||
Global_state.thread = nil
|
||||
reset_viewport()
|
||||
A()
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
quit_all_editors = function(node)
|
||||
if node.type == 'text' and not node.button then
|
||||
edit.quit(node.editor)
|
||||
elseif node.type == 'rows' or node.type == 'cols' then
|
||||
for _,child in ipairs(node.data) do
|
||||
quit_all_editors(child, dt)
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,5 @@
|
|||
on.quit = function()
|
||||
if Global_state.thread then
|
||||
quit_all_editors(Global_state.thread)
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue