From a664a58af473f46e9a20aa62b8ec938fd6ccf81a Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Wed, 9 Dec 2015 12:50:40 -0800 Subject: [PATCH] Call rl_newline instead of attempting to simulate. --- Console.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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; } -- 2.45.2