mirror of
git://git.sv.gnu.org/nano.git
synced 2024-11-30 00:23:28 +03:00
tweaks: merge two functions, as the one is used only by the other
This commit is contained in:
parent
c55d144748
commit
71d0847b19
11
src/global.c
11
src/global.c
@ -1361,17 +1361,6 @@ void shortcut_init(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Return something. */
|
||||
const funcstruct *sctofunc(const keystruct *s)
|
||||
{
|
||||
funcstruct *f = allfuncs;
|
||||
|
||||
while (f != NULL && f->func != s->func)
|
||||
f = f->next;
|
||||
|
||||
return f;
|
||||
}
|
||||
|
||||
#ifndef NANO_TINY
|
||||
/* Return the textual description that corresponds to the given flag. */
|
||||
const char *flagtostr(int flag)
|
||||
|
@ -1622,9 +1622,13 @@ bool wanted_to_move(void (*func)(void))
|
||||
/* Return TRUE when the given shortcut is admissible in view mode. */
|
||||
bool okay_for_view(const keystruct *shortcut)
|
||||
{
|
||||
const funcstruct *func = sctofunc(shortcut);
|
||||
funcstruct *item = allfuncs;
|
||||
|
||||
return (func == NULL || func->viewok);
|
||||
/* Search the function of the given shortcut in the list of functions. */
|
||||
while (item != NULL && item->func != shortcut->func)
|
||||
item = item->next;
|
||||
|
||||
return (item == NULL || item->viewok);
|
||||
}
|
||||
|
||||
/* Read in a keystroke. Act on the keystroke if it is a shortcut or a toggle;
|
||||
|
@ -323,7 +323,6 @@ functionptrtype func_from_key(int *kbinput);
|
||||
int keycode_from_string(const char *keystring);
|
||||
void assign_keyinfo(keystruct *s, const char *keystring, const int keycode);
|
||||
void shortcut_init(void);
|
||||
const funcstruct *sctofunc(const keystruct *s);
|
||||
const char *flagtostr(int flag);
|
||||
#ifdef ENABLE_NANORC
|
||||
keystruct *strtosc(const char *input);
|
||||
|
Loading…
Reference in New Issue
Block a user