]> git.saurik.com Git - cycript.git/commitdiff
Sometimes readline forced the display to update.
authorJay Freeman (saurik) <saurik@saurik.com>
Sat, 11 Jan 2014 15:35:09 +0000 (07:35 -0800)
committerJay Freeman (saurik) <saurik@saurik.com>
Sat, 11 Jan 2014 15:35:55 +0000 (07:35 -0800)
Display.cpp

index 402e717f0b9569048972885888f0619e1d933793..23b2e089118faefdac9b38f1ca5218c2af999863 100644 (file)
@@ -124,6 +124,7 @@ void CYDisplayStart(int meta) {
 void CYDisplayUpdate() {
     rl_display_fixed = 1;
     rl_redisplay();
+    current_ = CYCursor(_rl_last_v_pos, _rl_last_c_pos);
 
 #if RL_READLINE_VERSION >= 0x0600
     const char *prompt(rl_display_prompt);
@@ -148,8 +149,6 @@ void CYDisplayUpdate() {
     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();
 
     if (current_.imag() == 0)
         CYDisplayOutput(putchar, width, " ");
@@ -158,6 +157,9 @@ void CYDisplayUpdate() {
     CYDisplayMove(target);
     fflush(stdout);
 
+    _rl_last_v_pos = current_.real();
+    _rl_last_c_pos = current_.imag();
+
     width_ = width;
     point_ = rl_point;
 }