Thumbnail

rani/cscroll.git

Clone URL: https://git.buni.party/rani/cscroll.git

commit f52d89d8484e927a474ee96b7e76d943208b0427 Author: Raniconduh <clagv.randomgames@gmail.com> Date: Sun Aug 21 00:24:11 2022 +0000 dont allow cursor to go past files on mouse click diff --git a/src/main.c b/src/main.c index 1063884..3dbb5a9 100644 --- a/src/main.c +++ b/src/main.c @@ -1477 +1477 @@ int main(int argc, char ** argv) {   if (getmouse(&mouse_event) == OK) {   int mrow = mouse_event.y; // row @ mouse click; start @ 1   if (mrow < 3 || mrow > LINES - 3) break; // 3 pad top/bottom - if ((unsigned)mrow - 3 > n_dir_entries) break; + if ((unsigned)mrow - 3 >= n_dir_entries) break;     cursor = first_f + mrow - 2; // 3-pad, mrow>0   }