forked from lix-project/lix
Merge pull request #7944 from yorickvP/fix-curRepl
NixRepl::mainLoop: restore old curRepl on function exit
This commit is contained in:
commit
d93c1514eb
|
@ -252,7 +252,9 @@ void NixRepl::mainLoop()
|
||||||
el_hist_size = 1000;
|
el_hist_size = 1000;
|
||||||
#endif
|
#endif
|
||||||
read_history(historyFile.c_str());
|
read_history(historyFile.c_str());
|
||||||
|
auto oldRepl = curRepl;
|
||||||
curRepl = this;
|
curRepl = this;
|
||||||
|
Finally restoreRepl([&] { curRepl = oldRepl; });
|
||||||
#ifndef READLINE
|
#ifndef READLINE
|
||||||
rl_set_complete_func(completionCallback);
|
rl_set_complete_func(completionCallback);
|
||||||
rl_set_list_possib_func(listPossibleCallback);
|
rl_set_list_possib_func(listPossibleCallback);
|
||||||
|
|
Loading…
Reference in a new issue