From e798115c765df7fefcbd9b30bcf1041fc99262a3 Mon Sep 17 00:00:00 2001 From: Raito Bezarius Date: Tue, 9 Dec 2025 23:15:31 +0100 Subject: [PATCH] libcmd/repl: factor `inDebugger` The completions for debug commands is purposefully left out because it is going to go away in the next changes. Change-Id: Ibc78b7587de3f15857bb09a3a0732334693ad550 Signed-off-by: Raito Bezarius --- lix/libcmd/repl.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lix/libcmd/repl.cc b/lix/libcmd/repl.cc index 38b849054..b92e1ea14 100644 --- a/lix/libcmd/repl.cc +++ b/lix/libcmd/repl.cc @@ -150,6 +150,11 @@ struct NixRepl StorePath getDerivationPath(Value & v); ProcessLineResult processLine(std::string line); + bool inDebugger() const + { + return evaluator.debug && evaluator.debug->inDebugger; + } + void loadFile(const Path & path); void loadFlake(const std::string & flakeRef); void loadFiles(); @@ -292,7 +297,7 @@ ReplExitStatus NixRepl::mainLoop() { if (isFirstRepl) { std::string_view debuggerNotice = ""; - if (evaluator.debug && evaluator.debug->inDebugger) { + if (inDebugger()) { debuggerNotice = " debugger"; } notice("Lix %1%%2%\nType :? for help.", Uncolored(nixVersion), debuggerNotice);