mirror of
https://github.com/jarun/nnn.git
synced 2024-11-28 05:41:31 +00:00
Disable rollover at edges on scroll
This commit is contained in:
parent
3f0c604111
commit
6001eeb9a4
|
@ -4303,13 +4303,14 @@ nochange:
|
||||||
|
|
||||||
#if NCURSES_MOUSE_VERSION > 1
|
#if NCURSES_MOUSE_VERSION > 1
|
||||||
/* Scroll up */
|
/* Scroll up */
|
||||||
if (event.bstate == BUTTON4_PRESSED && ndents) {
|
if (event.bstate == BUTTON4_PRESSED && ndents && (cfg.rollover || cur)) {
|
||||||
move_cursor((cur + ndents - 1) % ndents, 0);
|
move_cursor((cur + ndents - 1) % ndents, 0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Scroll down */
|
/* 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);
|
move_cursor((cur + 1) % ndents, 0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue