cosmetic fixes

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3735 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
This commit is contained in:
David Lawrence Ramsey 2006-07-04 23:03:59 +00:00
parent afa1542b76
commit 015c434be1

View File

@ -92,7 +92,7 @@ char *do_browser(char *path, DIR *dir)
titlebar(path); titlebar(path);
while (!abort) { while (!abort) {
size_t fileline; size_t fileline = (width != 0) ? selected / width : selected;
/* The line number the selected file is on. */ /* The line number the selected file is on. */
size_t old_selected = selected; size_t old_selected = selected;
/* The selected file we had before the current selected /* The selected file we had before the current selected
@ -112,12 +112,6 @@ char *do_browser(char *path, DIR *dir)
prev_dir = NULL; prev_dir = NULL;
} }
/* Calculate the line number we're on now, so that we don't
* divide by zero. */
fileline = selected;
if (width != 0)
fileline /= width;
switch (kbinput) { switch (kbinput) {
#ifndef DISABLE_MOUSE #ifndef DISABLE_MOUSE
case KEY_MOUSE: case KEY_MOUSE:
@ -192,7 +186,7 @@ char *do_browser(char *path, DIR *dir)
case NANO_NEXTPAGE_KEY: case NANO_NEXTPAGE_KEY:
selected += (editwinrows - fileline % editwinrows) * selected += (editwinrows - fileline % editwinrows) *
width; width;
if (selected >= filelist_len) if (selected > filelist_len - 1)
selected = filelist_len - 1; selected = filelist_len - 1;
break; break;
case NANO_FIRSTFILE_ALTKEY: case NANO_FIRSTFILE_ALTKEY: