about summary refs log tree commit diff stats
path: root/src/ldo.c
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2022-01-03 23:36:44 -0800
committerKartik K. Agaram <vc@akkartik.com>2022-01-03 23:36:44 -0800
commit4018c2e8e2499c1a8a625ef717ae9dc242bd83e3 (patch)
tree430bbb12f66159f164b7f3090e36aa46fae42582 /src/ldo.c
parent7812ebc5f119cd4c47e6a91db0561008c7080bc5 (diff)
downloadteliva-4018c2e8e2499c1a8a625ef717ae9dc242bd83e3.tar.gz
when editing a function, show its callers
No way to select between them. That complicates the UI too much when we
do so much with the cursor. But it's still useful to suggest things to
type in after ctrl-g.
Diffstat (limited to 'src/ldo.c')
-rw-r--r--src/ldo.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/ldo.c b/src/ldo.c
index 6316b24..e1bf316 100644
--- a/src/ldo.c
+++ b/src/ldo.c
@@ -283,9 +283,10 @@ void record_metadata_about_function_call (lua_State *L, CallInfo *ci) {
     return;
   int g = GETARG_Bx(i);  /* global index */
   lua_assert(ttisstring(&p->k[g]));
+  int call_graph_depth = ci - L->base_ci;
   const char* function_name = svalue(&p->k[g]);
-  assign_call_graph_depth_to_name(L, ci - L->base_ci, function_name);
-  save_caller(L, function_name);
+  assign_call_graph_depth_to_name(L, call_graph_depth, function_name);
+  save_caller(L, function_name, call_graph_depth);
 }