2014-04-14 Benno Schulenberg <bensberg@justemail.net>
* src/{proto.h,cut.c,nano.c,text.c}: Remove the unused parameter
'file_bot' from copy_from_filestruct(), and rename the other.
+ * src/*: Remove the unused parameter 'func_key' from get_shortcut(),
+ and subsequently from parse_browser_input() and parse_help_input().
2014-04-13 Benno Schulenberg <bensberg@justemail.net>
* proto.h, global.c, rcfile.c: Remove the unused parameter 'menu'
}
#endif /* !DISABLE_MOUSE */
- parse_browser_input(&kbinput, &meta_key, &func_key);
- s = get_shortcut(MBROWSER, &kbinput, &meta_key, &func_key);
+ parse_browser_input(&kbinput, &meta_key);
+ s = get_shortcut(MBROWSER, &kbinput, &meta_key);
if (!s)
continue;
f = sctofunc((sc *) s);
}
/* Determine the shortcut key corresponding to the values of kbinput
- * (the key itself), meta_key (whether the key is a meta sequence), and
- * func_key (whether the key is a function key), if any. In the
- * process, convert certain non-shortcut keys into their corresponding
+ * (the key itself) and meta_key (whether the key is a meta sequence).
+ * Also convert certain non-shortcut keys into their corresponding
* shortcut keys. */
-void parse_browser_input(int *kbinput, bool *meta_key, bool *func_key)
+void parse_browser_input(int *kbinput, bool *meta_key)
{
- get_shortcut(MBROWSER, kbinput, meta_key, func_key);
+ get_shortcut(MBROWSER, kbinput, meta_key);
/* Pico compatibility. */
if (!*meta_key) {
statusbar(_("Cancelled"));
return -1;
} else {
- s = get_shortcut(MBROWSER, &i, &meta_key, &func_key);
+ s = get_shortcut(MBROWSER, &i, &meta_key);
if (i == -2 || i == 0) {
#ifdef HAVE_REGEX_H
/* Use last_search if answer is an empty string, or
ans = mallocstrcpy(ans, answer);
- s = get_shortcut(currmenu, &i, &meta_key, &func_key);
+ s = get_shortcut(currmenu, &i, &meta_key);
#ifndef NANO_TINY
#ifndef DISABLE_MULTIBUFFER
break;
} else {
ans = mallocstrcpy(ans, answer);
- s = get_shortcut(currmenu, &i, &meta_key, &func_key);
+ s = get_shortcut(currmenu, &i, &meta_key);
#ifndef DISABLE_BROWSER
if (s && s->scfunc == to_files_void) {
}
#endif
- parse_help_input(&kbinput, &meta_key, &func_key);
- s = get_shortcut(MHELP, &kbinput, &meta_key, &func_key);
+ parse_help_input(&kbinput, &meta_key);
+ s = get_shortcut(MHELP, &kbinput, &meta_key);
if (!s)
continue;
f = sctofunc((sc *) s);
}
/* Determine the shortcut key corresponding to the values of kbinput
- * (the key itself), meta_key (whether the key is a meta sequence), and
- * func_key (whether the key is a function key), if any. In the
- * process, convert certain non-shortcut keys into their corresponding
+ * (the key itself) and meta_key (whether the key is a meta sequence).
+ * Also convert certain non-shortcut keys into their corresponding
* shortcut keys. */
-void parse_help_input(int *kbinput, bool *meta_key, bool *func_key)
+void parse_help_input(int *kbinput, bool *meta_key)
{
- get_shortcut(MHELP, kbinput, meta_key, func_key);
+ get_shortcut(MHELP, kbinput, meta_key);
if (!*meta_key) {
switch (*kbinput) {
#endif
/* Check for a shortcut in the main list. */
- s = get_shortcut(MMAIN, &input, meta_key, func_key);
+ s = get_shortcut(MMAIN, &input, meta_key);
/* If we got a shortcut from the main list, or a "universal"
* edit window shortcut, set have_shortcut to TRUE. */
#endif
/* Check for a shortcut in the current list. */
- s = get_shortcut(currmenu, &input, meta_key, func_key);
+ s = get_shortcut(currmenu, &input, meta_key);
/* If we got a shortcut from the current list, or a "universal"
* statusbar prompt shortcut, set have_shortcut to TRUE. */
&ran_func, &finished, TRUE, refresh_func);
assert(statusbar_x <= strlen(answer));
- s = get_shortcut(currmenu, &kbinput, meta_key, func_key);
+ s = get_shortcut(currmenu, &kbinput, meta_key);
if (s)
if (s->scfunc == do_cancel || s->scfunc == do_enter_void)
currmenu = MYESNO;
kbinput = get_kbinput(bottomwin, &meta_key, &func_key);
- s = get_shortcut(currmenu, &kbinput, &meta_key, &func_key);
+ s = get_shortcut(currmenu, &kbinput, &meta_key);
if (s && s->scfunc == do_cancel)
ok = -1;
char *do_browser(char *path, DIR *dir);
char *do_browse_from(const char *inpath);
void browser_init(const char *path, DIR *dir);
-void parse_browser_input(int *kbinput, bool *meta_key, bool *func_key);
+void parse_browser_input(int *kbinput, bool *meta_key);
void browser_refresh(void);
bool browser_select_filename(const char *needle);
int filesearch_init(void);
#ifndef DISABLE_HELP
void do_help(void (*refresh_func)(void));
void help_init(void);
-void parse_help_input(int *kbinput, bool *meta_key, bool *func_key);
+void parse_help_input(int *kbinput, bool *meta_key);
size_t help_line_len(const char *ptr);
#endif
#ifndef DISABLE_MOUSE
int get_mouseinput(int *mouse_x, int *mouse_y, bool allow_shortcuts);
#endif
-const sc *get_shortcut(int menu, int *kbinput, bool
- *meta_key, bool *func_key);
+const sc *get_shortcut(int menu, int *kbinput, bool *meta_key);
const sc *first_sc_for(int menu, void (*func)(void));
void blank_line(WINDOW *win, int y, int x, int n);
void blank_titlebar(void);
return;
}
+ s = get_shortcut(currmenu, &i, &meta_key);
- s = get_shortcut(currmenu, &i, &meta_key, &func_key);
if (s && s->scfunc == gototext_void) {
/* Keep answer up on the statusbar. */
search_init(TRUE, TRUE);
* the keystroke and return. */
kbinput = do_input(&meta_key, &func_key, &s_or_t, &ran_func,
&finished, FALSE);
- s = get_shortcut(MMAIN, &kbinput, &meta_key, &func_key);
+ s = get_shortcut(MMAIN, &kbinput, &meta_key);
if (s && s->scfunc == do_uncut_text) {
/* Splice the justify buffer back into the file, but only if we
}
kbinput = get_kbinput(bottomwin, &meta_key, &func_key);
- s = get_shortcut(currmenu, &kbinput, &meta_key, &func_key);
+ s = get_shortcut(currmenu, &kbinput, &meta_key);
tmplint = curlint;
if (!s)
}
#endif /* !DISABLE_MOUSE */
-/* Return the shortcut corresponding to the values of kbinput (the key
- * itself), meta_key (whether the key is a meta sequence), and func_key
- * (whether the key is a function key), if any. The shortcut will be
- * the first one in the list (control key, meta key sequence, function
- * key, other meta key sequence) for the corresponding function. For
- * example, passing in a meta key sequence that corresponds to a
- * function with a control key, a function key, and a meta key sequence
- * will return the control key corresponding to that function. */
-const sc *get_shortcut(int menu, int *kbinput, bool
- *meta_key, bool *func_key)
+/* Return the shortcut that corresponds to the values of kbinput (the
+ * key itself) and meta_key (whether the key is a meta sequence). The
+ * returned shortcut will be the first in the list that corresponds to
+ * the given sequence. */
+const sc *get_shortcut(int menu, int *kbinput, bool *meta_key)
{
sc *s;
#ifdef DEBUG
- fprintf(stderr, "get_shortcut(): kbinput = %d, meta_key = %s, func_key = %s\n", *kbinput, *meta_key ? "TRUE" : "FALSE", *func_key ? "TRUE" : "FALSE");
+ fprintf(stderr, "get_shortcut(): kbinput = %d, meta_key = %s", *kbinput, *meta_key ? "TRUE" : "FALSE");
#endif
/* Check for shortcuts. */
&& ((s->type == META && *meta_key == TRUE && *kbinput == s->seq)
|| (s->type != META && *kbinput == s->seq))) {
#ifdef DEBUG
- fprintf (stderr, "matched seq \"%s\", and btw meta was %d (menus %x = %x)\n", s->keystr, *meta_key, menu, s->menu);
+ fprintf (stderr, "matched seq \"%s\", and btw meta was %d (menu is %x from %x)\n",
+ s->keystr, *meta_key, menu, s->menu);
#endif
return s;
}
if (kbinput == 0)
return NULL;
- s = get_shortcut(currmenu, &kbinput, &meta_key, &func_key);
+ s = get_shortcut(currmenu, &kbinput, &meta_key);
if (!s)
return NULL;