diff --git a/ChangeLog b/ChangeLog index c5e7ddec7d98a5d8507263309169068e42295877..0b4df1cc3d4096ab5ff453a07d2e153b03c6e4ca 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,7 @@ * global.c (shortcut_init): Remove mistaken browser item from the Go-To-Line menu. * global.c (shortcut_init): Delete a misplaced setting of 'currmenu'. + * global.c (shortcut_init, strtomenu): Cosmetic tweaks. 2014-04-10 Benno Schulenberg <bensberg@justemail.net> * doc/syntax/Makefile.am: Add four recent syntaxes to the packlist. diff --git a/src/global.c b/src/global.c index 2b7da227d1a10ecfa5de20424322eeb1fdea10c3..9547e8e4cdeb45c2f7570d9dcec5343a0340c393 100644 --- a/src/global.c +++ b/src/global.c @@ -605,7 +605,7 @@ void shortcut_init(void) #endif const char *nano_replace_msg = N_("Replace a string or a regular expression"); - const char *nano_gotoline_msg = N_("Go to line and column number"); + const char *nano_gotoline_msg = N_("Go to line and column number"); #ifndef NANO_TINY const char *nano_mark_msg = N_("Mark text at the cursor position"); const char *nano_whereis_next_msg = N_("Repeat last search"); @@ -735,6 +735,8 @@ void shortcut_init(void) free(f); } + /* Start populating the different menus with functions. */ + add_to_funcs(do_help_void, (MMAIN|MWHEREIS|MREPLACE|MREPLACE2|MGOTOLINE|MWRITEFILE|MINSERTFILE|MEXTCMD|MSPELL|MBROWSER|MWHEREISFILE|MGOTODIR|MLINTER), get_help_msg, IFSCHELP(nano_help_msg), FALSE, VIEW); @@ -1077,6 +1079,8 @@ void shortcut_init(void) goto_dir_msg, IFSCHELP(nano_gotodir_msg), FALSE, VIEW); #endif + /* Start associating key combos with functions in specific menus. */ + add_to_sclist(MMAIN|MWHEREIS|MREPLACE|MREPLACE2|MGOTOLINE|MWRITEFILE|MINSERTFILE|MEXTCMD|MSPELL|MBROWSER|MWHEREISFILE|MGOTODIR|MLINTER, "^G", do_help_void, 0, TRUE); add_to_sclist(MMAIN|MWHEREIS|MREPLACE|MREPLACE2|MGOTOLINE|MWRITEFILE|MINSERTFILE|MEXTCMD|MSPELL|MBROWSER|MWHEREISFILE|MGOTODIR|MLINTER, @@ -1248,8 +1252,7 @@ void shortcut_init(void) add_to_sclist(MWRITEFILE, "M-A", append_void, 0, FALSE); add_to_sclist(MWRITEFILE, "M-P", prepend_void, 0, FALSE); add_to_sclist(MWRITEFILE, "M-B", backup_file_void, 0, FALSE); - add_to_sclist(MWRITEFILE, "^T", to_files_void, 0, FALSE); - add_to_sclist(MINSERTFILE, "^T", to_files_void, 0, FALSE); + add_to_sclist(MWRITEFILE|MINSERTFILE, "^T", to_files_void, 0, FALSE); add_to_sclist(MINSERTFILE, "^X", ext_cmd_void, 0, FALSE); add_to_sclist(MMAIN, "^Z", do_suspend_void, 0, FALSE); add_to_sclist(MMAIN, "^L", total_refresh, 0, TRUE); @@ -1603,7 +1606,7 @@ int strtomenu(char *input) else if (!strcasecmp(input, "replace")) return MREPLACE; else if (!strcasecmp(input, "replace2") || - !strcasecmp(input, "replacewith")) + !strcasecmp(input, "replacewith")) return MREPLACE2; else if (!strcasecmp(input, "gotoline")) return MGOTOLINE; @@ -1612,7 +1615,7 @@ int strtomenu(char *input) else if (!strcasecmp(input, "insert")) return MINSERTFILE; else if (!strcasecmp(input, "externalcmd") || - !strcasecmp(input, "extcmd")) + !strcasecmp(input, "extcmd")) return MEXTCMD; else if (!strcasecmp(input, "help")) return MHELP;