nano

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

commit fde86518ae76d8a82ccc2cb629fb6702b2fa3134
parent 61b3aa66269885c1000a1898f7ce5d231033f029
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Wed, 29 Sep 2021 15:23:49 +0200

tweaks: rename a function, to be more fitting

The file wasn't marked; a piece of text was marked, resulting in
a region, and it is this region that gets written out to a file.

Diffstat:
Msrc/files.c | 4++--
Msrc/prototypes.h | 8++++----
Msrc/text.c | 2+-
3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/files.c b/src/files.c @@ -2047,7 +2047,7 @@ bool write_file(const char *name, FILE *thefile, bool normal, #ifndef NANO_TINY /* Write the marked region of the current buffer out to disk. * Return TRUE on success and FALSE on error. */ -bool write_marked_file(const char *name, FILE *stream, bool normal, +bool write_region_to_file(const char *name, FILE *stream, bool normal, kind_of_writing_type method) { linestruct *birthline, *topline, *botline, *stopper, *afterline; @@ -2324,7 +2324,7 @@ int do_writeout(bool exiting, bool withprompt) * the marked region; otherwise, write out the whole buffer. */ #ifndef NANO_TINY if (openfile->mark && withprompt && !exiting && !ISSET(RESTRICTED)) - return write_marked_file(answer, NULL, NORMAL, method); + return write_region_to_file(answer, NULL, NORMAL, method); else #endif return write_file(answer, NULL, NORMAL, method, ANNOTATE); diff --git a/src/prototypes.h b/src/prototypes.h @@ -294,11 +294,11 @@ bool outside_of_confinement(const char *currpath, bool allow_tabcomp); void init_backup_dir(void); #endif int copy_file(FILE *inn, FILE *out, bool close_out); -bool write_file(const char *name, FILE *thefile, bool tmp, - kind_of_writing_type method, bool fullbuffer); +bool write_file(const char *name, FILE *thefile, bool normal, + kind_of_writing_type method, bool annotate); #ifndef NANO_TINY -bool write_marked_file(const char *name, FILE *stream, bool tmp, - kind_of_writing_type method); +bool write_region_to_file(const char *name, FILE *stream, bool normal, + kind_of_writing_type method); #endif int do_writeout(bool exiting, bool withprompt); void do_writeout_void(void); diff --git a/src/text.c b/src/text.c @@ -2499,7 +2499,7 @@ void do_spell(void) #ifndef NANO_TINY if (openfile->mark) - okay = write_marked_file(temp_name, stream, TEMPORARY, OVERWRITE); + okay = write_region_to_file(temp_name, stream, TEMPORARY, OVERWRITE); else #endif okay = write_file(temp_name, stream, TEMPORARY, OVERWRITE, NONOTES);