From c06afaa2070cf1edd85e66066ee7c990deaaba37 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Thu, 22 Jun 2023 18:18:02 -0700 Subject: [PATCH] start saving changes --- 0018-on.update | 3 +++ 0136-update_all_editors | 9 +++++++++ 2 files changed, 12 insertions(+) create mode 100644 0136-update_all_editors diff --git a/0018-on.update b/0018-on.update index 615c059..bcec2e9 100644 --- a/0018-on.update +++ b/0018-on.update @@ -1,4 +1,7 @@ on.update = function(dt) + if Global_state.thread then + update_all_editors(Global_state.thread, dt) + end if Pan then set_mouse_cursor('hand') Viewport.x = Pan.x - App.mouse_x()/Viewport.zoom diff --git a/0136-update_all_editors b/0136-update_all_editors new file mode 100644 index 0000000..6a35ec8 --- /dev/null +++ b/0136-update_all_editors @@ -0,0 +1,9 @@ +update_all_editors = function(node, dt) + if node.type == 'text' and not node.button then + edit.update(node.editor, dt) + elseif node.type == 'rows' or node.type == 'cols' then + for _,child in ipairs(node.data) do + update_all_editors(child, dt) + end + end +end \ No newline at end of file