Skip to content

Commit 9e7aa5b

Browse files
committed
FIX: make trace output better aligned
1 parent b7d6dbe commit 9e7aa5b

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/core/c-do.c

+6-5
Original file line numberDiff line numberDiff line change
@@ -204,17 +204,18 @@ static REBVAL *Func_Word(REBINT dsf)
204204
return R_UNSET;
205205
}
206206

207-
static REBINT Init_Depth(void)
207+
static REBINT Init_Depth(REBINT plus)
208208
{
209209
// Check the trace depth is ok:
210-
int depth = Eval_Depth() - Trace_Depth;
210+
int depth = Eval_Depth() - Trace_Depth + plus;
211211
if (depth < 0 || depth >= Trace_Level) return -1;
212212
if (depth > 10) depth = 10;
213-
Debug_Space(4 * depth);
213+
Debug_Space(3 * depth);
214214
return depth;
215215
}
216216

217-
#define CHECK_DEPTH(d) if ((d = Init_Depth()) < 0) return;\
217+
#define CHECK_DEPTH(d) if ((d = Init_Depth(0)) < 0) return;
218+
#define CHECK_DEPTH_RET(d) if ((d = Init_Depth(1)) < 0) return;
218219

219220
void Trace_Line(REBSER *block, REBINT index, REBVAL *value)
220221
{
@@ -258,7 +259,7 @@ void Trace_Func(REBVAL *word, REBVAL *value)
258259
void Trace_Return(REBVAL *word, REBVAL *value)
259260
{
260261
int depth;
261-
CHECK_DEPTH(depth);
262+
CHECK_DEPTH_RET(depth);
262263
Debug_Fmt_(BOOT_STR(RS_TRACE,6), Get_Word_Name(word));
263264
Debug_Values(value, 1, 50);
264265
}

0 commit comments

Comments
 (0)