Skip to content

Commit

Permalink
Fix #2280 (lua console formatting can be broken)
Browse files Browse the repository at this point in the history
  • Loading branch information
CelticMinstrel committed Dec 9, 2017
1 parent b7881a0 commit 114b5c7
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/gui/dialogs/lua_interpreter.cpp
Expand Up @@ -131,12 +131,6 @@ class lua_interpreter::lua_model {
lua_kernel_base & L_;
std::stringstream log_;

// Lua kernel sends log strings to this function
// This is arranged by set_external_log call
void log_function(const std::string & str) {
log_ << font::escape_text(str);
}

public:
lua_model (lua_kernel_base & lk)
: L_(lk)
Expand All @@ -145,7 +139,10 @@ class lua_interpreter::lua_model {
DBG_LUA << "constructing a lua_interpreter::model\n";
//DBG_LUA << "incoming:\n" << lk.get_log().rdbuf() << "\n.\n";
log_ << lk.get_log().str() << std::flush;
L_.set_external_log([this](const std::string & str) { this->log_function(str); }); //register our log to get commands and output from the lua interpreter
// Lua kernel sends log strings to this function
L_.set_external_log([this](const std::string & str) {
log_ << font::escape_text(str);
});
//DBG_LUA << "received:\n" << log_.str() << "\n.\n";

DBG_LUA << "finished constructing a lua_interpreter::model\n";
Expand Down

0 comments on commit 114b5c7

Please sign in to comment.