* src/global.c (add_to_funcs): Add a pointer to the tail of the
functions list, to simplify and speed up adding new items. And
make use of it to remember the location of the Uncut item.
+ * src/global.c, src/files.c (make_new_buffer, close_buffer): Make
+ help lines show "Close" again when more than one buffer is open.
2014-04-24 Benno Schulenberg <bensberg@justemail.net>
* doc/faq.html: Update a few URLs, delete some obsolete ones, update
} else {
splice_opennode(openfile, make_new_opennode(), openfile->next);
openfile = openfile->next;
+ /* More than one file open, show Close in help lines. */
+ exitfunc->desc = close_tag;
}
/* Initialize the new buffer. */
/* Close the file buffer we had open before. */
unlink_opennode(openfile->prev);
- display_main_list();
+ /* If only one buffer is open now, show Exit in the help lines. */
+ if (openfile == openfile->next)
+ exitfunc->desc = exit_tag;
return TRUE;
}
/* Pointer to the start of the functions list. */
subnfunc *tailfunc;
/* Pointer to the last function in the list. */
+subnfunc *exitfunc;
+ /* Pointer to the special Exit/Close item. */
subnfunc *uncutfunc;
/* Pointer to the special Uncut/Unjustify item. */
}
#endif
-/* TRANSLATORS: Try to keep the next two strings at most 10 characters. */
+/* TRANSLATORS: Try to keep the next four strings at most 10 characters. */
+const char *exit_tag = N_("Exit");
+const char *close_tag = N_("Close");
const char *uncut_tag = N_("Uncut Text");
#ifndef DISABLE_JUSITIFY
const char *unjust_tag = N_("Unjustify");
/* Initialize the list of functions and the list of shortcuts. */
void shortcut_init(void)
{
- /* TRANSLATORS: Try to keep the next seven strings at most 10 characters. */
- const char *exit_tag = N_("Exit");
+ /* TRANSLATORS: Try to keep the next six strings at most 10 characters. */
const char *whereis_tag = N_("Where Is");
const char *prev_line_tag = N_("Prev Line");
const char *next_line_tag = N_("Next Line");
N_("Cancel"), IFSCHELP(nano_cancel_msg), FALSE, VIEW);
add_to_funcs(do_exit, MMAIN,
-#ifndef DISABLE_MULTIBUFFER
- openfile != NULL && openfile != openfile->next ? N_("Close") :
-#endif
exit_tag, IFSCHELP(nano_exit_msg), FALSE, VIEW);
+ /* Remember the entry for Exit, to be able to replace it with Close. */
+ exitfunc = tailfunc;
#ifndef DISABLE_BROWSER
add_to_funcs(do_exit, MBROWSER, exit_tag, IFSCHELP(nano_exitbrowser_msg), FALSE, VIEW);
extern undo_type last_action;
#endif
+extern const char *exit_tag;
+extern const char *close_tag;
extern const char *uncut_tag;
#ifndef DISABLE_JUSTIFY
extern const char *unjust_tag;
extern sc *sclist;
extern subnfunc *allfuncs;
+extern subnfunc *exitfunc;
extern subnfunc *uncutfunc;
#ifndef DISABLE_COLOR
extern syntaxtype *syntaxes;