From: Jay Freeman (saurik) Date: Wed, 9 Dec 2015 20:50:40 +0000 (-0800) Subject: Call rl_newline instead of attempting to simulate. X-Git-Tag: v0.9.590~231 X-Git-Url: https://git.saurik.com/cycript.git/commitdiff_plain/a664a58af473f46e9a20aa62b8ec938fd6ccf81a Call rl_newline instead of attempting to simulate. --- diff --git a/Console.cpp b/Console.cpp index 463189c..164438c 100644 --- a/Console.cpp +++ b/Console.cpp @@ -384,8 +384,9 @@ class History { static int CYConsoleKeyReturn(int count, int key) { rl_insert(count, '\n'); + bool done(false); if (rl_end != 0 && rl_point == rl_end && rl_line_buffer[0] == '?') - rl_done = 1; + done = true; else if (rl_point == rl_end) { std::string command(rl_line_buffer, rl_end); std::istringstream stream(command); @@ -399,15 +400,15 @@ static int CYConsoleKeyReturn(int count, int key) { if (driver.Parse() || !driver.errors_.empty()) for (CYDriver::Errors::const_iterator error(driver.errors_.begin()); error != driver.errors_.end(); ++error) { if (error->location_.begin.line != last + 1) - rl_done = 1; + done = true; break; } else - rl_done = 1; + done = true; } - if (rl_done) - std::cout << std::endl; + if (done) + return rl_newline(count, key); return 0; }