mirror of
git://git.sv.gnu.org/nano.git
synced 2024-11-22 21:01:24 +03:00
cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3735 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
This commit is contained in:
parent
afa1542b76
commit
015c434be1
@ -92,7 +92,7 @@ char *do_browser(char *path, DIR *dir)
|
||||
titlebar(path);
|
||||
|
||||
while (!abort) {
|
||||
size_t fileline;
|
||||
size_t fileline = (width != 0) ? selected / width : selected;
|
||||
/* The line number the selected file is on. */
|
||||
size_t old_selected = selected;
|
||||
/* The selected file we had before the current selected
|
||||
@ -112,12 +112,6 @@ char *do_browser(char *path, DIR *dir)
|
||||
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) {
|
||||
#ifndef DISABLE_MOUSE
|
||||
case KEY_MOUSE:
|
||||
@ -192,7 +186,7 @@ char *do_browser(char *path, DIR *dir)
|
||||
case NANO_NEXTPAGE_KEY:
|
||||
selected += (editwinrows - fileline % editwinrows) *
|
||||
width;
|
||||
if (selected >= filelist_len)
|
||||
if (selected > filelist_len - 1)
|
||||
selected = filelist_len - 1;
|
||||
break;
|
||||
case NANO_FIRSTFILE_ALTKEY:
|
||||
|
Loading…
Reference in New Issue
Block a user