typedef std::complex<int> CYCursor;
+extern "C" int rl_display_fixed;
extern "C" int _rl_vis_botlin;
extern "C" int _rl_last_c_pos;
extern "C" int _rl_last_v_pos;
current_ = target;
}
-void CYDisplayStart(int meta) {
- rl_prep_terminal(meta);
- current_ = CYCursor();
-}
-
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);
#else
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, " ");
CYDisplayMove(target);
fflush(stdout);
+ _rl_last_v_pos = current_.real();
+ _rl_last_c_pos = current_.imag();
+
width_ = width;
point_ = rl_point;
}
-void CYDisplayFinish() {
- rl_deprep_terminal();
-}
-
#endif