Removing the now unused and unneeded addition ability to the shortcut list.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5079 35c25a1d-7b9e-4130-9fde-d3aeb78583b8master
parent
7ffc7b0438
commit
d23283e249
|
@ -1,3 +1,7 @@
|
||||||
|
2014-07-27 Benno Schulenberg <bensberg@justemail.net>
|
||||||
|
* src/global.c (add_to_sclist): Remove the now unused and unneeded
|
||||||
|
addition ability from this builder function of the shortcut list.
|
||||||
|
|
||||||
2014-07-24 Jordi Mallach <jordi@gnu.org>
|
2014-07-24 Jordi Mallach <jordi@gnu.org>
|
||||||
* doc/texinfo/nano.texi, doc/man/nanorc.5: Typo fix.
|
* doc/texinfo/nano.texi, doc/man/nanorc.5: Typo fix.
|
||||||
|
|
||||||
|
|
35
src/global.c
35
src/global.c
|
@ -343,37 +343,26 @@ const sc *first_sc_for(int menu, void (*func)(void))
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Add a key combo to the shortcut list. */
|
||||||
/* Add a string to the shortcut list.
|
|
||||||
* Allows updates to existing entries in the list. */
|
|
||||||
void add_to_sclist(int menu, const char *scstring, void (*func)(void), int toggle)
|
void add_to_sclist(int menu, const char *scstring, void (*func)(void), int toggle)
|
||||||
{
|
{
|
||||||
sc *s;
|
static sc *tailsc;
|
||||||
|
sc *s = (sc *)nmalloc(sizeof(sc));
|
||||||
|
|
||||||
if (sclist == NULL) {
|
/* Start the list, or tack on the next item. */
|
||||||
sclist = (sc *)nmalloc(sizeof(sc));
|
if (sclist == NULL)
|
||||||
s = sclist;
|
sclist = s;
|
||||||
|
else
|
||||||
|
tailsc->next = s;
|
||||||
|
tailsc = s;
|
||||||
s->next = NULL;
|
s->next = NULL;
|
||||||
} else {
|
|
||||||
for (s = sclist; s->next != NULL; s = s->next)
|
|
||||||
if (s->menu == menu && s->keystr == scstring)
|
|
||||||
break;
|
|
||||||
|
|
||||||
if (s->menu != menu || s->keystr != scstring) { /* i.e. this is not a replace... */
|
/* Fill in the data. */
|
||||||
#ifdef DEBUG
|
|
||||||
fprintf(stderr, "No match found...\n");
|
|
||||||
#endif
|
|
||||||
s->next = (sc *)nmalloc(sizeof(sc));
|
|
||||||
s = s->next;
|
|
||||||
s->next = NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
s->type = strtokeytype(scstring);
|
|
||||||
s->menu = menu;
|
s->menu = menu;
|
||||||
|
s->scfunc = func;
|
||||||
s->toggle = toggle;
|
s->toggle = toggle;
|
||||||
s->keystr = (char *) scstring;
|
s->keystr = (char *) scstring;
|
||||||
s->scfunc = func;
|
s->type = strtokeytype(scstring);
|
||||||
assign_keyinfo(s);
|
assign_keyinfo(s);
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
|
Loading…
Reference in New Issue