in open_(prev|next)_file(), translate the "New Buffer" string when

displaying "Switched to" messages on the statusbar; also do a few more
int -> bool conversions


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1959 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
master
David Lawrence Ramsey 2004-10-03 19:18:48 +00:00
parent 7c1f17ab6d
commit 3e189a8b9c
4 changed files with 18 additions and 15 deletions

View File

@ -76,6 +76,9 @@ CVS code -
- Simplify by reusing variables whereever possible, and add a - Simplify by reusing variables whereever possible, and add a
parameter execute to indicate whether or not to be in "Execute parameter execute to indicate whether or not to be in "Execute
Command" mode. (DLR) Command" mode. (DLR)
- open_prevfile(), open_nextfile()
- Translate the "New Buffer" string when displaying "Switched
to" messages on the statusbar. (DLR)
- global.c: - global.c:
shortcut_init() shortcut_init()
- Remove redundant NANO_SMALL #ifdef. (DLR) - Remove redundant NANO_SMALL #ifdef. (DLR)

View File

@ -696,7 +696,7 @@ void free_openfilestruct(openfilestruct *src)
* FALSE, a new entry is created; otherwise, the current entry is * FALSE, a new entry is created; otherwise, the current entry is
* updated. * updated.
*/ */
void add_open_file(int update) void add_open_file(bool update)
{ {
openfilestruct *tmp; openfilestruct *tmp;
@ -849,7 +849,7 @@ void load_open_file(void)
* Otherwise, we are about to close that entry, so don't bother doing * Otherwise, we are about to close that entry, so don't bother doing
* so. * so.
*/ */
void open_prevfile(int closing_file) void open_prevfile(bool closing_file)
{ {
if (open_files == NULL) if (open_files == NULL)
return; return;
@ -891,7 +891,7 @@ void open_prevfile(int closing_file)
load_open_file(); load_open_file();
statusbar(_("Switched to %s"), statusbar(_("Switched to %s"),
((open_files->filename[0] == '\0') ? "New Buffer" : ((open_files->filename[0] == '\0') ? _("New Buffer") :
open_files->filename)); open_files->filename));
#ifdef DEBUG #ifdef DEBUG
@ -909,7 +909,7 @@ void open_prevfile_void(void)
* FALSE, update the current entry before switching from it. Otherwise, * FALSE, update the current entry before switching from it. Otherwise,
* we are about to close that entry, so don't bother doing so. * we are about to close that entry, so don't bother doing so.
*/ */
void open_nextfile(int closing_file) void open_nextfile(bool closing_file)
{ {
if (open_files == NULL) if (open_files == NULL)
return; return;
@ -951,7 +951,7 @@ void open_nextfile(int closing_file)
load_open_file(); load_open_file();
statusbar(_("Switched to %s"), statusbar(_("Switched to %s"),
((open_files->filename[0] == '\0') ? "New Buffer" : ((open_files->filename[0] == '\0') ? _("New Buffer") :
open_files->filename)); open_files->filename));
#ifdef DEBUG #ifdef DEBUG
@ -967,14 +967,14 @@ void open_nextfile_void(void)
/* /*
* Delete an entry from the open_files filestruct. After deletion of an * Delete an entry from the open_files filestruct. After deletion of an
* entry, the next or previous entry is opened, whichever is found first. * entry, the next or previous entry is opened, whichever is found first.
* Return 0 on success or 1 on error. * Return TRUE on success or FALSE on error.
*/ */
int close_open_file(void) bool close_open_file(void)
{ {
openfilestruct *tmp; openfilestruct *tmp;
if (open_files == NULL) if (open_files == NULL)
return 1; return FALSE;
/* make sure open_files->fileage and fileage, and open_files->filebot /* make sure open_files->fileage and fileage, and open_files->filebot
and filebot, are in sync; they might not be if lines have been cut and filebot, are in sync; they might not be if lines have been cut
@ -988,14 +988,14 @@ int close_open_file(void)
else if (open_files->prev != NULL) else if (open_files->prev != NULL)
open_prevfile(TRUE); open_prevfile(TRUE);
else else
return 1; return FALSE;
unlink_opennode(tmp); unlink_opennode(tmp);
delete_opennode(tmp); delete_opennode(tmp);
shortcut_init(FALSE); shortcut_init(FALSE);
display_main_list(); display_main_list();
return 0; return TRUE;
} }
#endif /* ENABLE_MULTIBUFFER */ #endif /* ENABLE_MULTIBUFFER */

View File

@ -2688,7 +2688,7 @@ void do_exit(void)
if (i == 0 || (i == 1 && do_writeout(TRUE) > 0)) { if (i == 0 || (i == 1 && do_writeout(TRUE) > 0)) {
#ifdef ENABLE_MULTIBUFFER #ifdef ENABLE_MULTIBUFFER
/* Exit only if there are no more open buffers. */ /* Exit only if there are no more open buffers. */
if (close_open_file() != 0) if (!close_open_file())
#endif #endif
finish(); finish();
} else if (i != 1) } else if (i != 1)

View File

@ -190,13 +190,13 @@ void splice_opennode(openfilestruct *begin, openfilestruct *newnode,
void unlink_opennode(const openfilestruct *fileptr); void unlink_opennode(const openfilestruct *fileptr);
void delete_opennode(openfilestruct *fileptr); void delete_opennode(openfilestruct *fileptr);
void free_openfilestruct(openfilestruct *src); void free_openfilestruct(openfilestruct *src);
void add_open_file(int update); void add_open_file(bool update);
void load_open_file(void); void load_open_file(void);
void open_prevfile(int closing_file); void open_prevfile(bool closing_file);
void open_prevfile_void(void); void open_prevfile_void(void);
void open_nextfile(int closing_file); void open_nextfile(bool closing_file);
void open_nextfile_void(void); void open_nextfile_void(void);
int close_open_file(void); bool close_open_file(void);
#endif #endif
#if !defined(DISABLE_SPELLER) || !defined(DISABLE_OPERATINGDIR) #if !defined(DISABLE_SPELLER) || !defined(DISABLE_OPERATINGDIR)
char *get_full_path(const char *origpath); char *get_full_path(const char *origpath);