about summary refs log tree commit diff stats
path: root/src/kilo.c
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2021-11-13 15:07:14 -0800
committerKartik K. Agaram <vc@akkartik.com>2021-11-13 15:07:14 -0800
commitcbd5e7d5529027e7440bafa7e3ee6412bae3531d (patch)
treee944cf1bf7a985bdb184c9ec4409d24dd49b8719 /src/kilo.c
parente06a7b1a7b7f1748ca6bb22a53c91c9ab288a3d5 (diff)
downloadteliva-cbd5e7d5529027e7440bafa7e3ee6412bae3531d.tar.gz
.
Diffstat (limited to 'src/kilo.c')
-rw-r--r--src/kilo.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/kilo.c b/src/kilo.c
index f0a815c..3183639 100644
--- a/src/kilo.c
+++ b/src/kilo.c
@@ -1169,8 +1169,7 @@ static void editorMoveCursor(int key) {
     }
 }
 
-extern char* Current_definition;
-extern void write_definition_to_file(lua_State *L, char *name, char *outfilename);
+extern void save_to_current_definition_and_editor_buffer(lua_State *L, char *name);
 extern void load_editor_buffer_to_current_definition_in_image(lua_State *L);
 static void editorGo(lua_State* L, int fd) {
     char query[KILO_QUERY_LEN+1] = {0};
@@ -1189,8 +1188,7 @@ static void editorGo(lua_State* L, int fd) {
         } else if (c == ESC || c == ENTER) {
             editorSetStatusMessage("");
             if (c == ENTER) {
-              Current_definition = query;
-              write_definition_to_file(L, Current_definition, "teliva_editbuffer");
+              save_to_current_definition_and_editor_buffer(L, query);
               editorClear();
               editorOpen("teliva_editbuffer");
             }