diff --git a/0023-on.keychord_press b/0023-on.keychord_press index cdca4e1..2afb043 100644 --- a/0023-on.keychord_press +++ b/0023-on.keychord_press @@ -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() diff --git a/0137-quit_all_editors b/0137-quit_all_editors new file mode 100644 index 0000000..68f3ab5 --- /dev/null +++ b/0137-quit_all_editors @@ -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 \ No newline at end of file diff --git a/0138-on.quit b/0138-on.quit new file mode 100644 index 0000000..ebe45b0 --- /dev/null +++ b/0138-on.quit @@ -0,0 +1,5 @@ +on.quit = function() + if Global_state.thread then + quit_all_editors(Global_state.thread) + end +end \ No newline at end of file