aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2019-12-02 18:24:59 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2019-12-02 18:24:59 +0530
commit6001eeb9a47f963a07b0bd6559aa2b146588619c (patch)
tree55aac5d6ffd269bb132569dc12aa0412955800bb
parent3f0c604111ee8d16afaa26824cae5db070c30cff (diff)
downloadnnn-6001eeb9a47f963a07b0bd6559aa2b146588619c.tar.gz
Disable rollover at edges on scroll
-rw-r--r--src/nnn.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/nnn.c b/src/nnn.c
index 3d8db0e..54ff48f 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -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;
}