@@ -966,7 +966,7 @@ int Replxx::ReplxxImpl::virtual_render( char32_t const* buffer_, int len_, int&
966966 * Refresh the user's input line: the prompt is already onscreen and is not
967967 * redrawn here screen position
968968 */
969- void Replxx::ReplxxImpl::refresh_line ( HINT_ACTION hintAction_ ) {
969+ void Replxx::ReplxxImpl::refresh_line ( HINT_ACTION hintAction_, bool refreshPrompt_ ) {
970970 int long long now ( now_us () );
971971 int long long duration ( now - _lastRefreshTime );
972972 if ( duration < RAPID_REFRESH_US ) {
@@ -993,10 +993,22 @@ void Replxx::ReplxxImpl::refresh_line( HINT_ACTION hintAction_ ) {
993993
994994 // position at the end of the prompt, clear to end of previous input
995995 _terminal.set_cursor_visible ( false );
996- _terminal.jump_cursor (
997- _prompt.indentation (), // 0-based on Win32
998- -( _prompt._cursorRowOffset - _prompt._extraLines )
999- );
996+ if ( refreshPrompt_ )
997+ {
998+ _terminal.jump_cursor (
999+ 0 ,
1000+ -_prompt._cursorRowOffset
1001+ );
1002+ _prompt.write ();
1003+ _prompt._cursorRowOffset = _prompt._extraLines ;
1004+ }
1005+ else
1006+ {
1007+ _terminal.jump_cursor (
1008+ _prompt.indentation (), // 0-based on Win32
1009+ -( _prompt._cursorRowOffset - _prompt._extraLines )
1010+ );
1011+ }
10001012 // display the input line
10011013 if ( _hasNewlines ) {
10021014 _terminal.clear_screen ( Terminal::CLEAR_SCREEN ::TO_END );
@@ -1934,7 +1946,7 @@ Replxx::ACTION_RESULT Replxx::ReplxxImpl::history_move( bool previous_ ) {
19341946 }
19351947 _data.assign ( _history.current () );
19361948 _pos = _data.length ();
1937- refresh_line ();
1949+ refresh_line ( HINT_ACTION :: REGENERATE , true /* refreshPrompt */ );
19381950 return ( Replxx::ACTION_RESULT ::CONTINUE );
19391951}
19401952
@@ -2006,7 +2018,7 @@ Replxx::ACTION_RESULT Replxx::ReplxxImpl::history_jump( bool back_ ) {
20062018 _history.jump ( back_ );
20072019 _data.assign ( _history.current () );
20082020 _pos = _data.length ();
2009- refresh_line ();
2021+ refresh_line ( HINT_ACTION :: REGENERATE , true /* refreshPrompt */ );
20102022 }
20112023 return ( Replxx::ACTION_RESULT ::CONTINUE );
20122024}
0 commit comments