From ddd46ad4289f9020b511a220d0818b90ecf2cccf Mon Sep 17 00:00:00 2001 From: Wolfram Sang Date: Mon, 24 Oct 2016 15:21:14 +0200 Subject: [PATCH] cmd: shift: use correct context Don't work on the current context (might be a for-loop), but on the real active batch context. Fixes Bug #155. Signed-off-by: Wolfram Sang --- cmd/shift.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cmd/shift.c b/cmd/shift.c index 2d938a7..22a1580 100644 --- a/cmd/shift.c +++ b/cmd/shift.c @@ -29,18 +29,18 @@ int cmd_shift(char *param) { - if(bc == 0) { - /*!! not in batch - error */ + struct bcontext *b = activeBatchContext(); + if(!b) + /* not in batch - error */ return 1; - } assert(param); if(stricmp(param, "down") == 0) { - if(bc->shiftlevel) - bc->shiftlevel--; + if(b->shiftlevel) + b->shiftlevel--; } else /* shift up */ - bc->shiftlevel++; + b->shiftlevel++; return 0; } -- 2.9.3 .