Skip to content

Commit

Permalink
Merge pull request #28 from iyubondyrev/bondyrev/fix_replxx_for_bette…
Browse files Browse the repository at this point in the history
…r_hints

Adjust replxx handle_hints function
  • Loading branch information
alexey-milovidov authored Sep 21, 2024
2 parents 711c18e + dbfadb2 commit 9f72931
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/replxx_impl.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -875,6 +875,10 @@ void Replxx::ReplxxImpl::handle_hints( HINT_ACTION hintAction_ ) {
#ifdef _WIN32
-- maxCol;
#endif
startCol -= _hintContextLenght;
if ( startCol >= maxCol ) {
startCol = startCol % maxCol;
}
if ( _hintSelection < -1 ) {
_hintSelection = hintCount - 1;
} else if ( _hintSelection >= hintCount ) {
Expand All @@ -891,7 +895,6 @@ void Replxx::ReplxxImpl::handle_hints( HINT_ACTION hintAction_ ) {
set_color( Replxx::Color::DEFAULT );
}
}
startCol -= _hintContextLenght;
for ( int hintRow( 0 ); hintRow < min( hintCount, _maxHintRows ); ++ hintRow ) {
#ifdef _WIN32
_display.push_back( '\r' );
Expand All @@ -918,6 +921,7 @@ void Replxx::ReplxxImpl::handle_hints( HINT_ACTION hintAction_ ) {
set_color( Replxx::Color::DEFAULT );
}
}
set_color(Replxx::Color::DEFAULT);
return;
}

Expand Down Expand Up @@ -1080,7 +1084,7 @@ void Replxx::ReplxxImpl::repaint( void ) {
for ( int i( _prompt._extraLines ); i < _prompt._cursorRowOffset; ++ i ) {
_terminal.write8( "\n", 1 );
}
refresh_line( HINT_ACTION::SKIP );
refresh_line( HINT_ACTION::REPAINT );
}

void Replxx::ReplxxImpl::clear_self_to_end_of_screen( Prompt const* prompt_ ) {
Expand Down

0 comments on commit 9f72931

Please sign in to comment.