diff --git a/ChangeLog b/ChangeLog index fc1bcdc267add8eb3de4a2e9d5ab0561ed86c905..e0d93de152da3e9df46d456f659a2c1f02955c6b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -76,6 +76,9 @@ CVS code - - Simplify by reusing variables whereever possible, and add a parameter execute to indicate whether or not to be in "Execute Command" mode. (DLR) +- open_prevfile(), open_nextfile() + - Translate the "New Buffer" string when displaying "Switched + to" messages on the statusbar. (DLR) - global.c: shortcut_init() - Remove redundant NANO_SMALL #ifdef. (DLR) diff --git a/src/files.c b/src/files.c index 3f09ebd68c34aee82173ebd0c674a882611766b4..ca0c3a853d6a6538c2e9b2cc668e917dc6ae9f47 100644 --- a/src/files.c +++ b/src/files.c @@ -696,7 +696,7 @@ void free_openfilestruct(openfilestruct *src) * FALSE, a new entry is created; otherwise, the current entry is * updated. */ -void add_open_file(int update) +void add_open_file(bool update) { openfilestruct *tmp; @@ -849,7 +849,7 @@ void load_open_file(void) * Otherwise, we are about to close that entry, so don't bother doing * so. */ -void open_prevfile(int closing_file) +void open_prevfile(bool closing_file) { if (open_files == NULL) return; @@ -891,7 +891,7 @@ void open_prevfile(int closing_file) load_open_file(); statusbar(_("Switched to %s"), - ((open_files->filename[0] == '\0') ? "New Buffer" : + ((open_files->filename[0] == '\0') ? _("New Buffer") : open_files->filename)); #ifdef DEBUG @@ -909,7 +909,7 @@ void open_prevfile_void(void) * FALSE, update the current entry before switching from it. Otherwise, * 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) return; @@ -951,7 +951,7 @@ void open_nextfile(int closing_file) load_open_file(); statusbar(_("Switched to %s"), - ((open_files->filename[0] == '\0') ? "New Buffer" : + ((open_files->filename[0] == '\0') ? _("New Buffer") : open_files->filename)); #ifdef DEBUG @@ -967,14 +967,14 @@ void open_nextfile_void(void) /* * Delete an entry from the open_files filestruct. After deletion of an * 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; if (open_files == NULL) - return 1; + return FALSE; /* 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 @@ -988,14 +988,14 @@ int close_open_file(void) else if (open_files->prev != NULL) open_prevfile(TRUE); else - return 1; + return FALSE; unlink_opennode(tmp); delete_opennode(tmp); shortcut_init(FALSE); display_main_list(); - return 0; + return TRUE; } #endif /* ENABLE_MULTIBUFFER */ diff --git a/src/nano.c b/src/nano.c index abdd8f30e655506b564dbcc630758a633eccdd09..7c74982ea349051dde39f3582d1f93e8d6259fce 100644 --- a/src/nano.c +++ b/src/nano.c @@ -2688,7 +2688,7 @@ void do_exit(void) if (i == 0 || (i == 1 && do_writeout(TRUE) > 0)) { #ifdef ENABLE_MULTIBUFFER /* Exit only if there are no more open buffers. */ - if (close_open_file() != 0) + if (!close_open_file()) #endif finish(); } else if (i != 1) diff --git a/src/proto.h b/src/proto.h index 3038303521d4f2ad91dd7c74918b7c10b7134b8b..3f9061cf58c6c6f46bce02d2660ed27b46630cb8 100644 --- a/src/proto.h +++ b/src/proto.h @@ -190,13 +190,13 @@ void splice_opennode(openfilestruct *begin, openfilestruct *newnode, void unlink_opennode(const openfilestruct *fileptr); void delete_opennode(openfilestruct *fileptr); void free_openfilestruct(openfilestruct *src); -void add_open_file(int update); +void add_open_file(bool update); void load_open_file(void); -void open_prevfile(int closing_file); +void open_prevfile(bool closing_file); void open_prevfile_void(void); -void open_nextfile(int closing_file); +void open_nextfile(bool closing_file); void open_nextfile_void(void); -int close_open_file(void); +bool close_open_file(void); #endif #if !defined(DISABLE_SPELLER) || !defined(DISABLE_OPERATINGDIR) char *get_full_path(const char *origpath);