diff --git a/src/definitions.h b/src/definitions.h index 3f2ef3e6..8a2beadc 100644 --- a/src/definitions.h +++ b/src/definitions.h @@ -246,7 +246,7 @@ /* Enumeration types. */ typedef enum { - NIX_FILE, DOS_FILE, MAC_FILE + UNSPECIFIED, NIX_FILE, DOS_FILE, MAC_FILE } format_type; typedef enum { diff --git a/src/files.c b/src/files.c index 0b7f62a3..4f135f03 100644 --- a/src/files.c +++ b/src/files.c @@ -83,7 +83,7 @@ void make_new_buffer(void) openfile->mark = NULL; openfile->softmark = FALSE; - openfile->fmt = NIX_FILE; + openfile->fmt = UNSPECIFIED; openfile->undotop = NULL; openfile->current_undo = NULL; @@ -821,9 +821,11 @@ void read_file(FILE *f, int fd, const char *filename, bool undoable) num_lines), num_lines); } #endif - else + else { + openfile->fmt = NIX_FILE; statusline(HUSH, P_("Read %zu line", "Read %zu lines", num_lines), num_lines); + } /* If we inserted less than a screenful, don't center the cursor. */ if (undoable && less_than_a_screenful(was_lineno, was_leftedge)) diff --git a/src/winio.c b/src/winio.c index 0f770ebe..7d852db8 100644 --- a/src/winio.c +++ b/src/winio.c @@ -2230,7 +2230,7 @@ void statusline(message_type importance, const char *msg, ...) va_end(ap); #ifdef ENABLE_MULTIBUFFER - if (!we_are_running && importance == ALERT && openfile && + if (!we_are_running && importance == ALERT && openfile && !openfile->fmt && !openfile->errormessage && openfile->next != openfile) openfile->errormessage = copy_of(compound); #endif