diff options
| author | Maxime Coste <mawww@kakoune.org> | 2024-04-29 12:18:25 +1000 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2024-04-29 12:21:02 +1000 |
| commit | 1c71fc0c097f14ba857936fb56253c65abbb62d6 (patch) | |
| tree | e2e2ddec41af5513ef4d844458f812154085eae7 /src/commands.cc | |
| parent | e8ad943532f2211dcbaeb2e75f71ef2f6516dd7f (diff) | |
Add local scope to user commands
Diffstat (limited to 'src/commands.cc')
| -rw-r--r-- | src/commands.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/commands.cc b/src/commands.cc index d8335664..373f3b5c 100644 --- a/src/commands.cc +++ b/src/commands.cc @@ -1404,6 +1404,7 @@ void define_command(const ParametersParser& parser, Context& context, const Shel desc = ParameterDesc{ {}, ParameterDesc::Flags::SwitchesAsPositional, min, max }; cmd = [=](const ParametersParser& parser, Context& context, const ShellContext& sc) { + LocalScope local_scope{context}; CommandManager::instance().execute(commands, context, { params_to_shell(parser), sc.env_vars }); }; @@ -1412,6 +1413,7 @@ void define_command(const ParametersParser& parser, Context& context, const Shel { desc = ParameterDesc{ {}, ParameterDesc::Flags::SwitchesAsPositional, 0, 0 }; cmd = [=](const ParametersParser& parser, Context& context, const ShellContext& sc) { + LocalScope local_scope{context}; CommandManager::instance().execute(commands, context, { {}, sc.env_vars }); }; } |
