We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 628f2d3 + 2e3bea1 commit a7270e8Copy full SHA for a7270e8
1 file changed
src/listview_curses.cc
@@ -297,8 +297,13 @@ listview_curses::handle_key(const ncinput& ch)
297
{
298
this->set_selection(0_vl);
299
} else {
300
- auto shift_amount
301
- = -(this->rows_available(this->lv_top, RD_UP) - 1_vl);
+ auto rows_avail = this->rows_available(this->lv_top, RD_UP);
+ if (rows_avail <= 1_vl) {
302
+ // may happen in case of jumping over very long lines
303
+ // and we need to garantee at least some movement
304
+ rows_avail = 2_vl;
305
+ }
306
+ auto shift_amount = -(rows_avail - 1_vl);
307
this->shift_top(shift_amount);
308
}
309
break;
0 commit comments