diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2021-11-28 14:36:42 -0800 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2021-11-28 14:36:42 -0800 |
commit | f8176bfe67f4d846140ee0c44a10c4bb5f58450a (patch) | |
tree | 7ae199010f97c66fc146d45d90c7bc363af29a8c /src | |
parent | cfb366af800a15556527b4a79a9ba5ce7a22c520 (diff) | |
download | teliva-f8176bfe67f4d846140ee0c44a10c4bb5f58450a.tar.gz |
take one responsibility away from edit_image
Also rename it appropriately.
Diffstat (limited to 'src')
-rw-r--r-- | src/lua.c | 8 |
1 files changed, 4 insertions, 4 deletions
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; } |