Disable rollover at edges on scroll

This commit is contained in:
Arun Prakash Jana 2019-12-02 18:24:59 +05:30
parent 3f0c604111
commit 6001eeb9a4
No known key found for this signature in database
GPG Key ID: A75979F35C080412
1 changed files with 3 additions and 2 deletions

View File

@ -4303,13 +4303,14 @@ nochange:
#if NCURSES_MOUSE_VERSION > 1
/* Scroll up */
if (event.bstate == BUTTON4_PRESSED && ndents) {
if (event.bstate == BUTTON4_PRESSED && ndents && (cfg.rollover || cur)) {
move_cursor((cur + ndents - 1) % ndents, 0);
break;
}
/* Scroll down */
if (event.bstate == BUTTON5_PRESSED && ndents) {
if (event.bstate == BUTTON5_PRESSED && ndents
&& (cfg.rollover || (cur != ndents - 1))) {
move_cursor((cur + 1) % ndents, 0);
break;
}