From 1bba59e972a3267ffc29ceba3e238cf8993f0c9c Mon Sep 17 00:00:00 2001 From: Tomas Babej Date: Sat, 3 Apr 2021 10:30:18 -0400 Subject: [PATCH] CLI2: Move the recursion block to the right place in addContext --- src/CLI2.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/CLI2.cpp b/src/CLI2.cpp index fbef416f6..f8031bf04 100644 --- a/src/CLI2.cpp +++ b/src/CLI2.cpp @@ -627,7 +627,9 @@ void CLI2::addContext (bool readable, bool writeable) } } - // Apply the context. Readable (filtering) takes precedence. + // Apply the context. Readable (filtering) takes precedence. Also set the + // block now, since addFilter calls analyze(), which calls addContext(). + _context_added = true; if (readable) addFilter (contextString); else if (writeable) @@ -639,9 +641,6 @@ void CLI2::addContext (bool readable, bool writeable) "Context '{1}' set. Use 'task context none' to remove.", Context::getContext ().config.get ("context") )); - - // Set the block, we don't want to apply context multiple times by accident. - _context_added = true; } ////////////////////////////////////////////////////////////////////////////////