make the file browser's mouse support consistent with other mouse

support, and add a few comment fixes


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3743 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
master
David Lawrence Ramsey 2006-07-05 02:34:37 +00:00
parent 60d22f012a
commit bc7dc36c7d
1 changed files with 8 additions and 7 deletions

View File

@ -131,7 +131,7 @@ char *do_browser(char *path, DIR *dir)
if (!get_mouseinput(&mouse_x, &mouse_y, TRUE)) { if (!get_mouseinput(&mouse_x, &mouse_y, TRUE)) {
/* We can click in the edit window to select a /* We can click in the edit window to select a
* file. */ * filename. */
if (wenclose(edit, mouse_y, mouse_x)) { if (wenclose(edit, mouse_y, mouse_x)) {
/* Subtract out the size of topwin. */ /* Subtract out the size of topwin. */
mouse_y -= 2 - no_more_space(); mouse_y -= 2 - no_more_space();
@ -144,19 +144,20 @@ char *do_browser(char *path, DIR *dir)
width) + (mouse_x / (longest + 2)); width) + (mouse_x / (longest + 2));
/* If they clicked beyond the end of a row, /* If they clicked beyond the end of a row,
* select the file at the end of that * select the filename at the end of that
* row. */ * row. */
if (mouse_x > width * (longest + 2)) if (mouse_x > width * (longest + 2))
selected--; selected--;
/* If we're off the screen, select the last /* If we're off the screen, select the last
* file. If we clicked the same place as * filename. */
* last time, read in the file there. */
if (selected > filelist_len - 1) if (selected > filelist_len - 1)
selected = filelist_len - 1; selected = filelist_len - 1;
else if (old_selected == selected)
/* Put back the Enter key, so that the /* If we selected the same filename as last
* file is read in. */ * time, put back the Enter key so that it's
* read in. */
if (old_selected == selected)
unget_kbinput(NANO_ENTER_KEY, FALSE, unget_kbinput(NANO_ENTER_KEY, FALSE,
FALSE); FALSE);
} }