aboutsummaryrefslogtreecommitdiff
path: root/src/libcmd/repl.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libcmd/repl.cc')
-rw-r--r--src/libcmd/repl.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/libcmd/repl.cc b/src/libcmd/repl.cc
index 635b54958..5086e9999 100644
--- a/src/libcmd/repl.cc
+++ b/src/libcmd/repl.cc
@@ -652,9 +652,12 @@ ProcessLineResult NixRepl::processLine(std::string line)
// using runProgram2 to allow editors to display their UI
runProgram2(RunOptions { .program = editor, .searchPath = true, .args = args }).wait();
- // Reload right after exiting the editor
- state->resetFileCache();
- reloadFiles();
+ // Reload right after exiting the editor if path is not in store
+ // Store is immutable, so there could be no changes, so there's no need to reload
+ if (!state->store->isInStore(path.resolveSymlinks().path.abs())) {
+ state->resetFileCache();
+ reloadFiles();
+ }
}
else if (command == ":t") {