mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-25 23:36:16 +02:00
Merge pull request #5752 from NixOS/5706-repl-reassign
Properly take the last assignment in the REPL
This commit is contained in:
commit
c7b66caaca
2 changed files with 3 additions and 0 deletions
|
@ -672,6 +672,8 @@ void NixRepl::addVarToScope(const Symbol & name, Value & v)
|
|||
{
|
||||
if (displ >= envSize)
|
||||
throw Error("environment full; cannot add more variables");
|
||||
if (auto oldVar = staticEnv.find(name); oldVar != staticEnv.vars.end())
|
||||
staticEnv.vars.erase(oldVar);
|
||||
staticEnv.vars.emplace_back(name, displ);
|
||||
staticEnv.sort();
|
||||
env->values[displ++] = &v;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
source common.sh
|
||||
|
||||
replCmds="
|
||||
simple = 1
|
||||
simple = import ./simple.nix
|
||||
:b simple
|
||||
:log simple
|
||||
|
|
Loading…
Reference in a new issue