mirror of git://git.sv.gnu.org/nano.git
tweaks: prevent the adding of an unwanted newline in a different way
The prevention is needed only for temporary files, not for normal files.
This commit is contained in:
parent
3def429290
commit
0f23729253
|
@ -2085,7 +2085,7 @@ bool write_region_to_file(const char *name, FILE *stream, bool normal,
|
|||
get_region(&topline, &top_x, &botline, &bot_x);
|
||||
|
||||
/* When needed, prepare a magic end line for the region. */
|
||||
if (bot_x > 0 && !ISSET(NO_NEWLINES)) {
|
||||
if (normal && bot_x > 0 && !ISSET(NO_NEWLINES)) {
|
||||
stopper = make_new_node(botline);
|
||||
stopper->data = copy_of("");
|
||||
} else
|
||||
|
|
|
@ -2516,9 +2516,6 @@ void do_spell(void)
|
|||
/* Save the settings of the global flags. */
|
||||
memcpy(stash, flags, sizeof(flags));
|
||||
|
||||
/* Don't add an extra newline when writing out the (selected) text. */
|
||||
SET(NO_NEWLINES);
|
||||
|
||||
#ifndef NANO_TINY
|
||||
if (openfile->mark)
|
||||
okay = write_region_to_file(temp_name, stream, TEMPORARY, OVERWRITE);
|
||||
|
|
Loading…
Reference in New Issue