tweaks: rename two empty functions, to be more to the point
Also, move them to global.c, where all the other empty functions are.master
parent
87cde1590d
commit
e9f0597e2e
24
src/global.c
24
src/global.c
|
@ -291,6 +291,14 @@ void regexp_void(void)
|
||||||
void backwards_void(void)
|
void backwards_void(void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
#ifdef ENABLE_HISTORIES
|
||||||
|
void get_older_item(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
void get_newer_item(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
#endif
|
||||||
void flip_replace(void)
|
void flip_replace(void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -851,9 +859,9 @@ void shortcut_init(void)
|
||||||
N_("No Replace"), WITHORSANS(whereis_gist), BLANKAFTER, VIEW);
|
N_("No Replace"), WITHORSANS(whereis_gist), BLANKAFTER, VIEW);
|
||||||
|
|
||||||
#ifdef ENABLE_HISTORIES
|
#ifdef ENABLE_HISTORIES
|
||||||
add_to_funcs(get_history_older_void, MWHEREIS|MREPLACE|MREPLACEWITH|MWHEREISFILE,
|
add_to_funcs(get_older_item, MWHEREIS|MREPLACE|MREPLACEWITH|MWHEREISFILE,
|
||||||
N_("Older"), WITHORSANS(older_gist), TOGETHER, VIEW);
|
N_("Older"), WITHORSANS(older_gist), TOGETHER, VIEW);
|
||||||
add_to_funcs(get_history_newer_void, MWHEREIS|MREPLACE|MREPLACEWITH|MWHEREISFILE,
|
add_to_funcs(get_newer_item, MWHEREIS|MREPLACE|MREPLACEWITH|MWHEREISFILE,
|
||||||
N_("Newer"), WITHORSANS(newer_gist), BLANKAFTER, VIEW);
|
N_("Newer"), WITHORSANS(newer_gist), BLANKAFTER, VIEW);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1426,17 +1434,17 @@ void shortcut_init(void)
|
||||||
add_to_sclist(MWHEREIS|MREPLACE, "^R", 0, flip_replace, 0);
|
add_to_sclist(MWHEREIS|MREPLACE, "^R", 0, flip_replace, 0);
|
||||||
add_to_sclist(MWHEREIS|MGOTOLINE, "^T", 0, flip_goto, 0);
|
add_to_sclist(MWHEREIS|MGOTOLINE, "^T", 0, flip_goto, 0);
|
||||||
#ifdef ENABLE_HISTORIES
|
#ifdef ENABLE_HISTORIES
|
||||||
add_to_sclist(MWHEREIS|MREPLACE|MREPLACEWITH|MWHEREISFILE|MFINDINHELP|MEXECUTE, "^P", 0, get_history_older_void, 0);
|
add_to_sclist(MWHEREIS|MREPLACE|MREPLACEWITH|MWHEREISFILE|MFINDINHELP|MEXECUTE, "^P", 0, get_older_item, 0);
|
||||||
add_to_sclist(MWHEREIS|MREPLACE|MREPLACEWITH|MWHEREISFILE|MFINDINHELP|MEXECUTE, "^N", 0, get_history_newer_void, 0);
|
add_to_sclist(MWHEREIS|MREPLACE|MREPLACEWITH|MWHEREISFILE|MFINDINHELP|MEXECUTE, "^N", 0, get_newer_item, 0);
|
||||||
#ifdef ENABLE_UTF8
|
#ifdef ENABLE_UTF8
|
||||||
if (using_utf8()) {
|
if (using_utf8()) {
|
||||||
add_to_sclist(MWHEREIS|MREPLACE|MREPLACEWITH|MWHEREISFILE|MFINDINHELP|MEXECUTE, "\xE2\x96\xb4", KEY_UP, get_history_older_void, 0);
|
add_to_sclist(MWHEREIS|MREPLACE|MREPLACEWITH|MWHEREISFILE|MFINDINHELP|MEXECUTE, "\xE2\x96\xb4", KEY_UP, get_older_item, 0);
|
||||||
add_to_sclist(MWHEREIS|MREPLACE|MREPLACEWITH|MWHEREISFILE|MFINDINHELP|MEXECUTE, "\xE2\x96\xbe", KEY_DOWN, get_history_newer_void, 0);
|
add_to_sclist(MWHEREIS|MREPLACE|MREPLACEWITH|MWHEREISFILE|MFINDINHELP|MEXECUTE, "\xE2\x96\xbe", KEY_DOWN, get_newer_item, 0);
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
add_to_sclist(MWHEREIS|MREPLACE|MREPLACEWITH|MWHEREISFILE|MFINDINHELP|MEXECUTE, "Up", KEY_UP, get_history_older_void, 0);
|
add_to_sclist(MWHEREIS|MREPLACE|MREPLACEWITH|MWHEREISFILE|MFINDINHELP|MEXECUTE, "Up", KEY_UP, get_older_item, 0);
|
||||||
add_to_sclist(MWHEREIS|MREPLACE|MREPLACEWITH|MWHEREISFILE|MFINDINHELP|MEXECUTE, "Down", KEY_DOWN, get_history_newer_void, 0);
|
add_to_sclist(MWHEREIS|MREPLACE|MREPLACEWITH|MWHEREISFILE|MFINDINHELP|MEXECUTE, "Down", KEY_DOWN, get_newer_item, 0);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifdef ENABLE_JUSTIFY
|
#ifdef ENABLE_JUSTIFY
|
||||||
|
|
|
@ -145,14 +145,6 @@ void update_history(linestruct **item, const char *text)
|
||||||
*item = *hbot;
|
*item = *hbot;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Two empty placeholder functions. */
|
|
||||||
void get_history_older_void(void)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
void get_history_newer_void(void)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef ENABLE_TABCOMP
|
#ifdef ENABLE_TABCOMP
|
||||||
/* Go backward through one of three history lists, starting at its item h,
|
/* Go backward through one of three history lists, starting at its item h,
|
||||||
* searching for a string that is a tab completion of the given string s,
|
* searching for a string that is a tab completion of the given string s,
|
||||||
|
|
|
@ -304,8 +304,8 @@ int do_statusbar_input(bool *finished)
|
||||||
if (shortcut->func == do_tab || shortcut->func == do_enter)
|
if (shortcut->func == do_tab || shortcut->func == do_enter)
|
||||||
;
|
;
|
||||||
#ifdef ENABLE_HISTORIES
|
#ifdef ENABLE_HISTORIES
|
||||||
else if (shortcut->func == get_history_older_void ||
|
else if (shortcut->func == get_older_item ||
|
||||||
shortcut->func == get_history_newer_void)
|
shortcut->func == get_newer_item)
|
||||||
;
|
;
|
||||||
#endif
|
#endif
|
||||||
else if (shortcut->func == do_left)
|
else if (shortcut->func == do_left)
|
||||||
|
@ -504,7 +504,7 @@ functionptrtype acquire_an_answer(int *actual, bool *listed,
|
||||||
} else
|
} else
|
||||||
#endif /* ENABLE_TABCOMP */
|
#endif /* ENABLE_TABCOMP */
|
||||||
#ifdef ENABLE_HISTORIES
|
#ifdef ENABLE_HISTORIES
|
||||||
if (func == get_history_older_void) {
|
if (func == get_older_item) {
|
||||||
if (history_list != NULL) {
|
if (history_list != NULL) {
|
||||||
/* If we're scrolling up at the bottom of the history list
|
/* If we're scrolling up at the bottom of the history list
|
||||||
* and answer isn't blank, save answer in magichistory. */
|
* and answer isn't blank, save answer in magichistory. */
|
||||||
|
@ -519,7 +519,7 @@ functionptrtype acquire_an_answer(int *actual, bool *listed,
|
||||||
typing_x = strlen(answer);
|
typing_x = strlen(answer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (func == get_history_newer_void) {
|
} else if (func == get_newer_item) {
|
||||||
if (history_list != NULL) {
|
if (history_list != NULL) {
|
||||||
/* Get the newer search from the history list and save it in
|
/* Get the newer search from the history list and save it in
|
||||||
* answer. If there is no newer search, don't do anything. */
|
* answer. If there is no newer search, don't do anything. */
|
||||||
|
|
|
@ -336,8 +336,6 @@ void do_help(void);
|
||||||
void history_init(void);
|
void history_init(void);
|
||||||
void history_reset(const linestruct *list);
|
void history_reset(const linestruct *list);
|
||||||
void update_history(linestruct **item, const char *text);
|
void update_history(linestruct **item, const char *text);
|
||||||
void get_history_older_void(void);
|
|
||||||
void get_history_newer_void(void);
|
|
||||||
#ifdef ENABLE_TABCOMP
|
#ifdef ENABLE_TABCOMP
|
||||||
char *get_history_completion(linestruct **h, char *s, size_t len);
|
char *get_history_completion(linestruct **h, char *s, size_t len);
|
||||||
#endif
|
#endif
|
||||||
|
@ -632,6 +630,10 @@ void do_credits(void);
|
||||||
void case_sens_void(void);
|
void case_sens_void(void);
|
||||||
void regexp_void(void);
|
void regexp_void(void);
|
||||||
void backwards_void(void);
|
void backwards_void(void);
|
||||||
|
#ifdef ENABLE_HISTORIES
|
||||||
|
void get_older_item(void);
|
||||||
|
void get_newer_item(void);
|
||||||
|
#endif
|
||||||
void flip_replace(void);
|
void flip_replace(void);
|
||||||
void flip_goto(void);
|
void flip_goto(void);
|
||||||
#ifdef ENABLE_BROWSER
|
#ifdef ENABLE_BROWSER
|
||||||
|
|
|
@ -409,9 +409,9 @@ keystruct *strtosc(const char *input)
|
||||||
s->func = flip_goto;
|
s->func = flip_goto;
|
||||||
#ifdef ENABLE_HISTORIES
|
#ifdef ENABLE_HISTORIES
|
||||||
else if (!strcmp(input, "older"))
|
else if (!strcmp(input, "older"))
|
||||||
s->func = get_history_older_void;
|
s->func = get_older_item;
|
||||||
else if (!strcmp(input, "newer"))
|
else if (!strcmp(input, "newer"))
|
||||||
s->func = get_history_newer_void;
|
s->func = get_newer_item;
|
||||||
#endif
|
#endif
|
||||||
#ifndef NANO_TINY
|
#ifndef NANO_TINY
|
||||||
else if (!strcmp(input, "dosformat"))
|
else if (!strcmp(input, "dosformat"))
|
||||||
|
|
Loading…
Reference in New Issue