From f8176bfe67f4d846140ee0c44a10c4bb5f58450a Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sun, 28 Nov 2021 14:36:42 -0800 Subject: take one responsibility away from edit_image Also rename it appropriately. --- src/lua.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/lua.c b/src/lua.c index 4a051ee..a94c912 100644 --- a/src/lua.c +++ b/src/lua.c @@ -515,8 +515,7 @@ int load_editor_buffer_to_current_definition_in_image(lua_State *L) { /* But only if there are no errors. Otherwise things can get confusing. */ const char *Previous_error = NULL; extern int resumeEdit (lua_State *L); -int edit_image (lua_State *L, const char *definition) { - save_to_current_definition_and_editor_buffer(L, definition); +int edit_current_definition (lua_State *L) { int back_to_big_picture = edit_buffer(L, /*status message*/ ""); // error handling while (1) { @@ -900,7 +899,8 @@ restart: } else if (c == ESC) { return; } else if (c == ENTER) { - int back_to_big_picture = edit_image(L, query); + save_to_current_definition_and_editor_buffer(L, query); + int back_to_big_picture = edit_current_definition(L); if (back_to_big_picture) goto restart; return; } else if (c == CTRL_U) { @@ -952,7 +952,7 @@ int load_view_from_editor_state (lua_State *L) { int cx = lua_tointeger(L, -1); int back_to_big_picture = edit_from(L, "teliva_editor_buffer", /*error message*/ "", rowoff, coloff, cy, cx); lua_settop(L, editor_state_index); - // TODO: error handling like in edit_image + // TODO: error handling like in edit_current_definition return back_to_big_picture; } -- cgit 1.4.1-2-gfad0