From 711e1427b5eb80104b4d6ad1504f43ea958970d8 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Fri, 29 Aug 2014 09:46:34 +0100 Subject: 33057: %e in prompts shows evaluation / execution depth --- Src/prompt.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'Src/prompt.c') diff --git a/Src/prompt.c b/Src/prompt.c index 328ae3c66..47625351f 100644 --- a/Src/prompt.c +++ b/Src/prompt.c @@ -786,6 +786,19 @@ putpromptchar(int doprint, int endchar, unsigned int *txtchangep) if(bv->Rstring) stradd(bv->Rstring); break; + case 'e': + { + int depth = 0; + Funcstack fsptr = funcstack; + while (fsptr) { + depth++; + fsptr = fsptr->prev; + } + addbufspc(DIGBUFSIZE); + sprintf(bv->bp, "%d", depth); + bv->bp += strlen(bv->bp); + break; + } case 'I': if (funcstack && funcstack->tp != FS_SOURCE && !IN_EVAL_TRAP()) { -- cgit v1.2.3