Commit 169da094 authored by David Lawrence Ramsey's avatar David Lawrence Ramsey Committed by Benno Schulenberg
Browse files

files: don't change file format when inserting into an existing buffer

This fixes https://savannah.gnu.org/bugs/?52392.
parent e6a92b14
Showing with 5 additions and 1 deletion
+5 -1
...@@ -1031,6 +1031,7 @@ void do_insertfile(void) ...@@ -1031,6 +1031,7 @@ void do_insertfile(void)
char *given = mallocstrcpy(NULL, ""); char *given = mallocstrcpy(NULL, "");
/* The last answer the user typed at the statusbar prompt. */ /* The last answer the user typed at the statusbar prompt. */
#ifndef NANO_TINY #ifndef NANO_TINY
file_format original_fmt = openfile->fmt;
bool execute = FALSE; bool execute = FALSE;
#endif #endif
...@@ -1177,7 +1178,10 @@ void do_insertfile(void) ...@@ -1177,7 +1178,10 @@ void do_insertfile(void)
if (openfile->current->lineno != was_current_lineno || if (openfile->current->lineno != was_current_lineno ||
openfile->current_x != was_current_x) openfile->current_x != was_current_x)
set_modified(); set_modified();
#ifndef NANO_TINY
/* Don't change the format of the current file. */
openfile->fmt = original_fmt;
#endif
refresh_needed = TRUE; refresh_needed = TRUE;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment