2009-12-07 David Lawrence Ramsey <pooka109@gmail.com>

* global.c (shortcut_init): Many fixes for keybindings code oversights, including
          restore page up/down and GotoDir to browser,
        * browser.c (do_browser): Fix breaking out of a submenu (e.g. gotodir) breaks out
          of browser altogether.
        * doc/nanorc.sample.in: Add missing entries for fortran/ObjC/OCaml entries.



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4459 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
master
Chris Allegretta 2009-12-07 12:34:23 +00:00
parent b27b3a18a9
commit 5b25e07744
4 changed files with 31 additions and 20 deletions

View File

@ -1,3 +1,10 @@
2009-12-07 David Lawrence Ramsey <pooka109@gmail.com>
* global.c (shortcut_init): Many fixes for keybindings code oversights, including
restore page up/down and GotoDir to browser,
* browser.c (do_browser): Fix breaking out of a submenu (e.g. gotodir) breaks out
of browser altogether.
* doc/nanorc.sample.in: Add missing entries for fortran/ObjC/OCaml entries.
2009-12-03 David Lawrence Ramsey <pooka109@gmail.com> 2009-12-03 David Lawrence Ramsey <pooka109@gmail.com>
* global.c (shortcut_init) - Remove help shortcut from help shortcut list :-) Tweaked * global.c (shortcut_init) - Remove help shortcut from help shortcut list :-) Tweaked
to reorder exit shortcut to end of list to not mess up prev/next shortcut symmetry. to reorder exit shortcut to end of list to not mess up prev/next shortcut symmetry.

View File

@ -291,6 +291,15 @@
## Java ## Java
# include "@PKGDATADIR@/java.nanorc" # include "@PKGDATADIR@/java.nanorc"
## Fortran
# include "@PKGDATADIR@/fortran.nanorc"
## Objective-C
# include "@PKGDATADIR@/objc.nanorc"
## OCaml
# include "@PKGDATADIR@/ocaml.nanorc"
## AWK ## AWK
# include "@PKGDATADIR@/awk.nanorc" # include "@PKGDATADIR@/awk.nanorc"

View File

@ -232,7 +232,7 @@ char *do_browser(char *path, DIR *dir)
* blank out ans, since we're done with it. */ * blank out ans, since we're done with it. */
statusbar(_("Cancelled")); statusbar(_("Cancelled"));
ans = mallocstrcpy(ans, ""); ans = mallocstrcpy(ans, "");
break; continue;
} else if (i != 0) { } else if (i != 0) {
/* Put back the "Go to Directory" key and save /* Put back the "Go to Directory" key and save
* answer in ans, so that the file list is displayed * answer in ans, so that the file list is displayed
@ -240,7 +240,7 @@ char *do_browser(char *path, DIR *dir)
* typed before at the prompt is displayed again. */ * typed before at the prompt is displayed again. */
unget_kbinput(sc_seq_or(DO_GOTOLINECOLUMN_VOID, 0), FALSE, FALSE); unget_kbinput(sc_seq_or(DO_GOTOLINECOLUMN_VOID, 0), FALSE, FALSE);
ans = mallocstrcpy(ans, answer); ans = mallocstrcpy(ans, answer);
break; continue;
} }
/* We have a directory. Blank out ans, since we're done /* We have a directory. Blank out ans, since we're done
@ -266,7 +266,7 @@ char *do_browser(char *path, DIR *dir)
_("Can't go outside of %s in restricted mode"), _("Can't go outside of %s in restricted mode"),
operating_dir); operating_dir);
free(new_path); free(new_path);
break; continue;
} }
#endif #endif
@ -278,7 +278,7 @@ char *do_browser(char *path, DIR *dir)
strerror(errno)); strerror(errno));
beep(); beep();
free(new_path); free(new_path);
break; continue;
} }
/* Start over again with the new path value. */ /* Start over again with the new path value. */
@ -302,7 +302,7 @@ char *do_browser(char *path, DIR *dir)
if (strcmp(filelist[selected], "/..") == 0) { if (strcmp(filelist[selected], "/..") == 0) {
statusbar(_("Can't move up a directory")); statusbar(_("Can't move up a directory"));
beep(); beep();
break; continue;
} }
#ifndef DISABLE_OPERATINGDIR #ifndef DISABLE_OPERATINGDIR
@ -314,7 +314,7 @@ char *do_browser(char *path, DIR *dir)
_("Can't go outside of %s in restricted mode"), _("Can't go outside of %s in restricted mode"),
operating_dir); operating_dir);
beep(); beep();
break; continue;
} }
#endif #endif
@ -324,7 +324,7 @@ char *do_browser(char *path, DIR *dir)
statusbar(_("Error reading %s: %s"), statusbar(_("Error reading %s: %s"),
filelist[selected], strerror(errno)); filelist[selected], strerror(errno));
beep(); beep();
break; continue;
} }
/* If we've successfully opened a file, we're done, so /* If we've successfully opened a file, we're done, so
@ -332,7 +332,7 @@ char *do_browser(char *path, DIR *dir)
if (!S_ISDIR(st.st_mode)) { if (!S_ISDIR(st.st_mode)) {
retval = mallocstrcpy(NULL, filelist[selected]); retval = mallocstrcpy(NULL, filelist[selected]);
abort = TRUE; abort = TRUE;
break; continue;
/* If we've successfully opened a directory, and it's /* If we've successfully opened a directory, and it's
* "..", save the current directory in prev_dir, so that * "..", save the current directory in prev_dir, so that
* we can select it later. */ * we can select it later. */
@ -347,7 +347,7 @@ char *do_browser(char *path, DIR *dir)
statusbar(_("Error reading %s: %s"), statusbar(_("Error reading %s: %s"),
filelist[selected], strerror(errno)); filelist[selected], strerror(errno));
beep(); beep();
break; continue;
} }
path = mallocstrcpy(path, filelist[selected]); path = mallocstrcpy(path, filelist[selected]);

View File

@ -701,9 +701,9 @@ void shortcut_init(bool unjustify)
add_to_funcs(DO_SEARCH, MMAIN|MBROWSER, whereis_msg, add_to_funcs(DO_SEARCH, MMAIN|MBROWSER, whereis_msg,
IFSCHELP(nano_whereis_msg), FALSE, VIEW); IFSCHELP(nano_whereis_msg), FALSE, VIEW);
add_to_funcs(DO_PAGE_UP, MMAIN|MHELP, add_to_funcs(DO_PAGE_UP, MMAIN|MHELP|MBROWSER,
prev_page_msg, IFSCHELP(nano_prevpage_msg), FALSE, VIEW); prev_page_msg, IFSCHELP(nano_prevpage_msg), FALSE, VIEW);
add_to_funcs(DO_PAGE_DOWN, MMAIN|MHELP, add_to_funcs(DO_PAGE_DOWN, MMAIN|MHELP|MBROWSER,
next_page_msg, IFSCHELP(nano_nextpage_msg), TRUE, VIEW); next_page_msg, IFSCHELP(nano_nextpage_msg), TRUE, VIEW);
@ -792,12 +792,6 @@ void shortcut_init(bool unjustify)
#endif #endif
add_to_funcs(DO_PAGE_UP, MBROWSER,
prev_page_msg, IFSCHELP(nano_prevpage_msg), FALSE, VIEW);
add_to_funcs(DO_PAGE_DOWN, MBROWSER,
next_page_msg, IFSCHELP(nano_nextpage_msg), TRUE, VIEW);
add_to_funcs(DO_RIGHT, (MMAIN|MBROWSER), N_("Forward"), IFSCHELP(nano_forward_msg), add_to_funcs(DO_RIGHT, (MMAIN|MBROWSER), N_("Forward"), IFSCHELP(nano_forward_msg),
FALSE, VIEW); FALSE, VIEW);
add_to_funcs(DO_RIGHT, MALL, "", "", FALSE, VIEW); add_to_funcs(DO_RIGHT, MALL, "", "", FALSE, VIEW);
@ -1030,6 +1024,7 @@ void shortcut_init(bool unjustify)
add_to_sclist(MMAIN|MHELP|MBROWSER, "F2", DO_EXIT, 0, TRUE); add_to_sclist(MMAIN|MHELP|MBROWSER, "F2", DO_EXIT, 0, TRUE);
add_to_sclist(MMAIN, "^_", DO_GOTOLINECOLUMN_VOID, 0, TRUE); add_to_sclist(MMAIN, "^_", DO_GOTOLINECOLUMN_VOID, 0, TRUE);
add_to_sclist(MMAIN, "F13", DO_GOTOLINECOLUMN_VOID, 0, TRUE); add_to_sclist(MMAIN, "F13", DO_GOTOLINECOLUMN_VOID, 0, TRUE);
add_to_sclist(MMAIN, "M-G", DO_GOTOLINECOLUMN_VOID, 0, TRUE);
add_to_sclist(MMAIN, "^O", DO_WRITEOUT_VOID, 0, TRUE); add_to_sclist(MMAIN, "^O", DO_WRITEOUT_VOID, 0, TRUE);
add_to_sclist(MMAIN, "F3", DO_WRITEOUT_VOID, 0, TRUE); add_to_sclist(MMAIN, "F3", DO_WRITEOUT_VOID, 0, TRUE);
#ifndef DISABLE_JUSTIFY #ifndef DISABLE_JUSTIFY
@ -1057,9 +1052,6 @@ void shortcut_init(bool unjustify)
add_to_sclist(MMAIN, "^T", DO_SPELL, 0, TRUE); add_to_sclist(MMAIN, "^T", DO_SPELL, 0, TRUE);
add_to_sclist(MMAIN, "F12", DO_SPELL, 0, TRUE); add_to_sclist(MMAIN, "F12", DO_SPELL, 0, TRUE);
#endif #endif
add_to_sclist(MMAIN, "^_", DO_GOTOLINECOLUMN_VOID, 0, TRUE);
add_to_sclist(MMAIN, "F13", DO_GOTOLINECOLUMN_VOID, 0, TRUE);
add_to_sclist(MMAIN, "M-G", DO_GOTOLINECOLUMN_VOID, 0, TRUE);
add_to_sclist(MMAIN, "^\\", DO_REPLACE, 0, TRUE); add_to_sclist(MMAIN, "^\\", DO_REPLACE, 0, TRUE);
add_to_sclist(MMAIN, "F14", DO_REPLACE, 0, TRUE); add_to_sclist(MMAIN, "F14", DO_REPLACE, 0, TRUE);
add_to_sclist(MMAIN, "M-R", DO_REPLACE, 0, TRUE); add_to_sclist(MMAIN, "M-R", DO_REPLACE, 0, TRUE);
@ -1137,6 +1129,9 @@ void shortcut_init(bool unjustify)
add_to_sclist(MBROWSER|MWHEREISFILE, "M-|", FIRST_FILE_MSG, 0, TRUE); add_to_sclist(MBROWSER|MWHEREISFILE, "M-|", FIRST_FILE_MSG, 0, TRUE);
add_to_sclist(MBROWSER|MWHEREISFILE, "M-/", LAST_FILE_MSG, 0, TRUE); add_to_sclist(MBROWSER|MWHEREISFILE, "M-/", LAST_FILE_MSG, 0, TRUE);
add_to_sclist(MBROWSER|MWHEREISFILE, "M-?", LAST_FILE_MSG, 0, TRUE); add_to_sclist(MBROWSER|MWHEREISFILE, "M-?", LAST_FILE_MSG, 0, TRUE);
add_to_sclist(MBROWSER|MWHEREISFILE, "^_", GOTO_DIR_MSG, 0, TRUE);
add_to_sclist(MBROWSER|MWHEREISFILE, "F13", GOTO_DIR_MSG, 0, TRUE);
add_to_sclist(MBROWSER|MWHEREISFILE, "M-G", GOTO_DIR_MSG, 0, TRUE);
#ifndef NANO_TINY #ifndef NANO_TINY
add_to_sclist(MMAIN, "M-]", DO_FIND_BRACKET, 0, TRUE); add_to_sclist(MMAIN, "M-]", DO_FIND_BRACKET, 0, TRUE);
add_to_sclist(MMAIN, "M--", DO_SCROLL_UP, 0, TRUE); add_to_sclist(MMAIN, "M--", DO_SCROLL_UP, 0, TRUE);