nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit 169da094241d6ef83f730568049c79906aa6527b
parent e6a92b14067de0638429ec8fc58cd6934641f09f
Author: David Lawrence Ramsey <pooka109@gmail.com>
Date:   Sun, 12 Nov 2017 11:45:53 -0600

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

This fixes https://savannah.gnu.org/bugs/?52392.

Diffstat:
Msrc/files.c | 6+++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/files.c b/src/files.c @@ -1031,6 +1031,7 @@ void do_insertfile(void) char *given = mallocstrcpy(NULL, ""); /* The last answer the user typed at the statusbar prompt. */ #ifndef NANO_TINY + file_format original_fmt = openfile->fmt; bool execute = FALSE; #endif @@ -1177,7 +1178,10 @@ void do_insertfile(void) if (openfile->current->lineno != was_current_lineno || openfile->current_x != was_current_x) set_modified(); - +#ifndef NANO_TINY + /* Don't change the format of the current file. */ + openfile->fmt = original_fmt; +#endif refresh_needed = TRUE; }