From: Jay Freeman (saurik) Date: Sat, 11 Jan 2014 15:08:20 +0000 (-0800) Subject: CRLF from non-last line wrote result over command. X-Git-Tag: v0.9.500~76 X-Git-Url: https://git.saurik.com/cycript.git/commitdiff_plain/daf84f5ea916d698dd8a1bacf8aec1b296e20823?ds=sidebyside CRLF from non-last line wrote result over command. --- diff --git a/Display.cpp b/Display.cpp index d76ac1f..cafdc57 100644 --- a/Display.cpp +++ b/Display.cpp @@ -28,6 +28,8 @@ #include #endif +#if RL_READLINE_VERSION >= 0x0600 + #include #include "Highlight.hpp" @@ -36,6 +38,10 @@ typedef std::complex CYCursor; +extern "C" int _rl_vis_botlin; +extern "C" int _rl_last_c_pos; +extern "C" int _rl_last_v_pos; + CYCursor current_; int width_; size_t point_; @@ -137,6 +143,14 @@ void CYDisplayUpdate() { CYDisplayOutput(putchar, width, prompt); CYCursor target(CYDisplayOutput(putchar, width, stream.str().c_str(), rl_point)); + _rl_vis_botlin = current_.real(); + _rl_last_c_pos = current_.imag(); + _rl_last_v_pos = target.real(); + + // XXX: readline crashes trying to avoid an empty line if this is left at 0 :( + if (_rl_last_c_pos == 0) + _rl_last_c_pos = 1; + if (current_.imag() == 0) CYDisplayOutput(putchar, width, " "); putp(clr_eos); @@ -151,3 +165,5 @@ void CYDisplayUpdate() { void CYDisplayFinish() { rl_deprep_terminal(); } + +#endif