the functions and shortcuts lists before and after every Justify.
Also, look for ^U only in the main menu, to which ^W M-J factually
returns and which shortcut_init() "sneakily" sets.
+ * src/{proto.h,files.c,global.c,nano.c,rcfile.c}: Drop the obsolete
+ argument of shortcut_init(), and remove two unneeded calls of it.
2014-04-06 Benno Schulenberg <bensberg@justemail.net>
* src/global.c (shortcut_init): Limit M-T (cut-till-end-of-file) to
break;
}
}
- shortcut_init(FALSE);
-
free(ans);
}
#endif
-/* Initialize all shortcut lists. If unjustify is TRUE, replace
- * the Uncut shortcut in the main shortcut list with UnJustify. */
-void shortcut_init(bool unjustify)
+/* Initialize the list of functions and the list of shortcuts. */
+void shortcut_init(void)
{
/* TRANSLATORS: Try to keep the following strings at most 10 characters. */
const char *get_help_msg = N_("Get Help");
} else if (i != 1)
statusbar(_("Cancelled"));
- shortcut_init(FALSE);
display_main_list();
}
{
s->scfunc();
#ifndef DISABLE_COLOR
- /* The command might have re-initialized shortcuts,
- * in which case f is now invalid. Let's reload it. */
- f = sctofunc((sc *) s);
if (f && !f->viewok && openfile->syntax != NULL
&& openfile->syntax->nmultis > 0) {
reset_multis(openfile->current, FALSE);
#endif
}
- /* Set up the shortcut lists.
- * Need to do this before the rcfile. */
- shortcut_init(FALSE);
+ /* Set up the function and shortcut lists. This needs to be done
+ * before reading the rcfile, to be able to rebind/unbind keys. */
+ shortcut_init();
/* We've read through the command line options. Now back up the flags
* and values that are set, and read the rcfile(s). If the values
#endif
, int metaval, int funcval, int miscval, bool view, void
(*func)(void));
-void shortcut_init(bool unjustify);
+void shortcut_init(void);
#ifdef DEBUG
void thanks_for_all_the_fish(void);
#endif
else
rcfile_error(N_("Cannot unset flag \"%s\""),
rcopts[i].name);
- /* Looks like we still need this specific hack for undo */
+ /* If undo/redo was enabled, reinitialize the lists. */
if (strcasecmp(rcopts[i].name, "undo") == 0)
- shortcut_init(0);
+ shortcut_init();
break;
}
}