do_browser() - More Picoish keystrokes for the browser, ^P, ^N, etc, for up, down, etc, and add the consistent ^C to exit (Jim Knoble)

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@710 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
master
Chris Allegretta 2001-07-02 01:31:44 +00:00
parent df20e83412
commit a2c02e9c8d
2 changed files with 10 additions and 2 deletions

View File

@ -87,6 +87,8 @@ Cvs code -
- Added the "Goto Directory" code (Rocco) - Added the "Goto Directory" code (Rocco)
- Don't shift the size of the file is it's less than 1K. Fixed - Don't shift the size of the file is it's less than 1K. Fixed
files less than 1K being displayed as 0B (Rocco). files less than 1K being displayed as 0B (Rocco).
- More Picoish keystrokes for the browser, ^P, ^N, etc, for up,
down, etc, and add the consistent ^C to exit (Jim Knoble).
do_writeout() do_writeout()
- New code to allow writing selected text to a separate file. - New code to allow writing selected text to a separate file.
When this is done, the current state is prserved. When this is done, the current state is prserved.

10
files.c
View File

@ -1298,22 +1298,28 @@ char *do_browser(char *inpath)
break; break;
#endif #endif
#endif #endif
case NANO_UP_KEY:
case KEY_UP: case KEY_UP:
case 'u': case 'u':
if (selected - width >= 0) if (selected - width >= 0)
selected -= width; selected -= width;
break; break;
case NANO_BACK_KEY:
case KEY_LEFT: case KEY_LEFT:
case NANO_BACKSPACE_KEY:
case 127:
case 'l': case 'l':
if (selected > 0) if (selected > 0)
selected--; selected--;
break; break;
case KEY_DOWN: case KEY_DOWN:
case NANO_DOWN_KEY:
case 'd': case 'd':
if (selected + width <= numents - 1) if (selected + width <= numents - 1)
selected += width; selected += width;
break; break;
case KEY_RIGHT: case KEY_RIGHT:
case NANO_FORWARD_KEY:
case 'r': case 'r':
if (selected < numents - 1) if (selected < numents - 1)
selected++; selected++;
@ -1353,7 +1359,7 @@ char *do_browser(char *inpath)
selected = numents - 1; selected = numents - 1;
break; break;
case KEY_ENTER: case KEY_ENTER:
case NANO_CONTROL_M: case NANO_ENTER_KEY:
case 's': /* More Pico compatibility */ case 's': /* More Pico compatibility */
case 'S': case 'S':
@ -1427,11 +1433,11 @@ char *do_browser(char *inpath)
return do_browser(path); return do_browser(path);
/* Stuff we want to abort the browser */ /* Stuff we want to abort the browser */
case NANO_CONTROL_C:
case 'q': case 'q':
case 'Q': case 'Q':
case 'e': /* Pico compatibility, yeech */ case 'e': /* Pico compatibility, yeech */
case 'E': case 'E':
case NANO_CANCEL_KEY:
case NANO_EXIT_FKEY: case NANO_EXIT_FKEY:
abort = 1; abort = 1;
break; break;