]> git.wh0rd.org Git - nano.git/commitdiff
Some better page up/down fixes, added keypad_on() call for now
authorChris Allegretta <chrisa@asty.org>
Wed, 3 Jan 2001 15:09:27 +0000 (15:09 +0000)
committerChris Allegretta <chrisa@asty.org>
Wed, 3 Jan 2001 15:09:27 +0000 (15:09 +0000)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@435 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

files.c

diff --git a/files.c b/files.c
index 7fc950e15f52c37df1de53567ead5f24fdd62bdb..db496e5305e14bec567b953b94fd98e7709345a4 100644 (file)
--- a/files.c
+++ b/files.c
@@ -1205,6 +1205,7 @@ char *do_browser(char *inpath)
 
     titlebar(path);
     bottombars(browser_list, BROWSER_LIST_LEN);
+    keypad_on(TRUE);
     curs_set(0);
     wmove(edit, 0, 0);
     i = 0;
@@ -1240,28 +1241,29 @@ char *do_browser(char *inpath)
        case NANO_PREVPAGE_KEY:
        case KEY_PPAGE:
            if ((selected / width) % editwinrows == 0) {
-               if (selected - editwinrows >= 0)
-                   selected -= editwinrows; 
+               if (selected - (editwinrows * width) >= 0)
+                   selected -= editwinrows * width
                else
                    selected = 0;
            }
            else if (selected - (editwinrows + 
-                       (selected / width) %  editwinrows)  >= 0)
-               selected -= editwinrows + (selected / width) %  editwinrows; 
+                       (selected / width) % editwinrows) * width  >= 0)
+               selected -= (editwinrows + (selected / width) % 
+                               editwinrows) * width; 
            else
                selected = 0;
            break;
        case NANO_NEXTPAGE_KEY:
        case KEY_NPAGE: 
            if ((selected / width) % editwinrows == 0) {
-               if (selected + editwinrows <= numents - 1)
-                   selected += editwinrows; 
+               if (selected + (editwinrows * width) <= numents - 1)
+                   selected += editwinrows * width
                else
                    selected = numents - 1;
            }
            else if (selected + (editwinrows - 
-                       (selected / width) %  editwinrows) <= numents -  1)
-               selected += editwinrows - (selected / width) %  editwinrows
+                       (selected / width) %  editwinrows) * width <= numents - 1)
+               selected += (editwinrows - (selected / width) % editwinrows) * width
            else
                selected = numents - 1;
            break;