about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/kilo.c8
-rw-r--r--src/teliva.c6
2 files changed, 8 insertions, 6 deletions
diff --git a/src/kilo.c b/src/kilo.c
index d2e9b1a..1ed700f 100644
--- a/src/kilo.c
+++ b/src/kilo.c
@@ -1098,7 +1098,7 @@ static void editorGo(lua_State* L) {
                 editorOpen("teliva_editor_buffer");
                 attrset(A_NORMAL);
                 clear();
-                draw_callers_of_current_definition(L);
+                draw_current_definition_name_and_callers(L);
             }
             return;
         } else if (c == CTRL_U) {
@@ -1252,7 +1252,7 @@ int edit(lua_State* L, char* filename, char* definition_name) {
     editorOpen(filename);
     attrset(A_NORMAL);
     clear();
-    draw_callers_of_current_definition(L);
+    draw_current_definition_name_and_callers(L);
     while(!Quit) {
         /* update on resize */
         E.startcol = LINE_NUMBER_SPACE;
@@ -1377,7 +1377,7 @@ int editFrom(lua_State* L, char* filename, char* definition_name, int rowoff, in
     editorOpen(filename);
     attrset(A_NORMAL);
     clear();
-    draw_callers_of_current_definition(L);
+    draw_current_definition_name_and_callers(L);
     while(!Quit) {
         /* update on resize */
         E.startcol = LINE_NUMBER_SPACE;
@@ -1420,7 +1420,7 @@ int resumeEdit(lua_State* L) {
     Back_to_big_picture = 0;
     attrset(A_NORMAL);
     clear();
-    draw_callers_of_current_definition(L);
+    draw_current_definition_name_and_callers(L);
     while(!Quit) {
         /* update on resize */
         E.startcol = LINE_NUMBER_SPACE;
diff --git a/src/teliva.c b/src/teliva.c
index ed4ddab..b88a42b 100644
--- a/src/teliva.c
+++ b/src/teliva.c
@@ -699,8 +699,10 @@ int editor_view_in_progress(lua_State* L) {
 
 char Current_definition[CURRENT_DEFINITION_LEN+1] = {0};
 
-void draw_callers_of_current_definition(lua_State* L) {
+void draw_current_definition_name_and_callers(lua_State* L) {
   int oldtop = lua_gettop(L);
+  mvaddstr(0, 0, "");
+  draw_definition_name(Current_definition);
   luaL_newmetatable(L, "__teliva_caller");
   int ct = lua_gettop(L);
   lua_getfield(L, ct, Current_definition);
@@ -711,7 +713,7 @@ void draw_callers_of_current_definition(lua_State* L) {
   }
   int ctc = lua_gettop(L);
   attron(COLOR_PAIR(COLOR_PAIR_FADE));
-  mvaddstr(0, 0, "callers: ");
+  addstr("callers: ");
   attroff(COLOR_PAIR(COLOR_PAIR_FADE));
   for (lua_pushnil(L); lua_next(L, ctc) != 0; lua_pop(L, 1)) {
     const char* caller_name = lua_tostring(L, -2);