commit 69a28122c1c0f6cc783d9cff03f9fd7ddaf9c0bc
parent 76356bd05bc0d72438cfac1320943fc2f049ed49
Author: David Lawrence Ramsey <pooka109@gmail.com>
Date: Thu, 12 Aug 2004 04:34:00 +0000
make sure that the shortcut list properly displays "Close" when reading
in multiple files on the command line
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1895 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
Diffstat:
2 files changed, 15 insertions(+), 7 deletions(-)
diff --git a/ChangeLog b/ChangeLog
@@ -163,7 +163,10 @@ CVS code -
NLS is enabled or not. (Junichi Uekawa)
- Add titlebar() calls before all open_file() calls and remove
the titlebar() call after them, so that the titlebar is
- displayed properly for all file(s) loaded. (DLR)
+ displayed properly for all file(s) loaded. Also call
+ display_main_list() after adding the first file to open_files,
+ so that "Close" is properly displayed then instead of "Exit".
+ (DLR)
- nano.h:
- Reassign the key for full justification to Ctrl-U, for
compatibility with the current version of Pico. (DLR)
diff --git a/src/nano.c b/src/nano.c
@@ -3459,23 +3459,21 @@ int main(int argc, char *argv[])
#endif
#ifdef DEBUG
- fprintf(stderr, "Main: bottom win\n");
+ fprintf(stderr, "Main: top and bottom win\n");
#endif
- /* Set up bottom of window */
+ titlebar(NULL);
display_main_list();
#ifdef DEBUG
fprintf(stderr, "Main: open file\n");
#endif
-
- titlebar(NULL);
open_file(filename, FALSE, FALSE);
#ifdef ENABLE_MULTIBUFFER
/* If we're using multibuffers and more than one file is specified
on the command line, load them all and switch to the first one
- afterward */
+ afterward. */
if (optind + 1 < argc) {
- bool old_multibuffer = ISSET(MULTIBUFFER);
+ bool old_multibuffer = ISSET(MULTIBUFFER), list = FALSE;
SET(MULTIBUFFER);
for (optind++; optind < argc; optind++) {
add_open_file(TRUE);
@@ -3484,6 +3482,13 @@ int main(int argc, char *argv[])
titlebar(NULL);
open_file(filename, FALSE, FALSE);
load_file(FALSE);
+ /* Display the main list with "Close" if we haven't
+ * already. */
+ if (!list) {
+ shortcut_init(FALSE);
+ list = TRUE;
+ display_main_list();
+ }
}
open_nextfile_void();
if (!old_multibuffer)