Can now use /CPL to reload lua source

This commit is contained in:
2021-12-15 14:18:19 -05:00
parent c689422206
commit e0001127c7
11 changed files with 115 additions and 13 deletions

View File

@@ -63,6 +63,10 @@ public:
master_->invoke(Invocation(Invocation::KIND_TICK, admin_id_, admin_id_, ""));
}
void do_cpl_command(const util::StringVec &words) {
rescan_lua_source();
}
void do_quit_command(const util::StringVec &words) {
stop_driver();
}
@@ -73,6 +77,7 @@ public:
else if (words[0] == "luaprobe") do_luaprobe_command(words);
else if (words[0] == "syntax") do_syntax_command(words);
else if (words[0] == "tick") do_tick_command(words);
else if (words[0] == "cpl") do_cpl_command(words);
else if (words[0] == "quit") do_quit_command(words);
else {
stdostream() << "Unsupported command: " << words[0] << std::endl;
@@ -127,6 +132,9 @@ public:
}
virtual void event_update() {
// If the driver has reloaded the source, put it into master model.
master_->update_source(get_lua_source());
// Check for keyboard input on stdin.
while (true) {
std::string line = get_stdio_channel()->in()->readline();