tweaks: refer to the magic line as "magic line", not as "magicline"

master
Benno Schulenberg 2019-01-06 15:35:31 +01:00
parent 911eb0cf2a
commit f74a120803
6 changed files with 12 additions and 14 deletions

View File

@ -309,7 +309,7 @@ void do_cut_text(bool copy_text, bool marked, bool cut_till_eof, bool append)
cb_save = cutbottom;
cb_save_len = strlen(cutbottom->data);
}
/* Don't add a magicline when moving text to the cutbuffer. */
/* Don't add a magic line when moving text to the cutbuffer. */
SET(NO_NEWLINES);
}
@ -346,7 +346,7 @@ void do_cut_text(bool copy_text, bool marked, bool cut_till_eof, bool append)
if (right_side_up)
openfile->placewewant = xplustabs();
}
/* Restore the magicline behavior now that we're done fiddling. */
/* Restore the magic-line behavior now that we're done fiddling. */
if (!old_no_newlines)
UNSET(NO_NEWLINES);
} else

View File

@ -565,7 +565,7 @@ void replace_marked_buffer(const char *filename)
if (descriptor < 0)
return;
/* Don't add a magicline when replacing text in the buffer. */
/* Don't add a magic line when replacing text in the buffer. */
SET(NO_NEWLINES);
add_undo(COUPLE_BEGIN);
@ -582,7 +582,7 @@ void replace_marked_buffer(const char *filename)
/* Insert the processed file where the marked text was. */
read_file(f, descriptor, filename, TRUE);
/* Restore the magicline behavior now that we're done fiddling. */
/* Restore the magic-line behavior now that we're done fiddling. */
if (!old_no_newlines)
UNSET(NO_NEWLINES);
@ -2049,7 +2049,6 @@ bool write_marked_file(const char *name, FILE *f_open, bool tmp,
{
bool retval;
bool added_magicline = FALSE;
/* Whether we added a magicline after filebot. */
filestruct *top, *bot;
size_t top_x, bot_x;
@ -2058,7 +2057,7 @@ bool write_marked_file(const char *name, FILE *f_open, bool tmp,
(const filestruct **)&bot, &bot_x, NULL);
filepart = partition_filestruct(top, top_x, bot, bot_x);
/* If we are doing magicline, and the last line of the partition
/* If we are using a magic line, and the last line of the partition
* isn't blank, then add a newline at the end of the buffer. */
if (!ISSET(NO_NEWLINES) && openfile->filebot->data[0] != '\0') {
new_magicline();
@ -2067,7 +2066,6 @@ bool write_marked_file(const char *name, FILE *f_open, bool tmp,
retval = write_file(name, f_open, tmp, method, FALSE);
/* If we added a magicline, remove it now. */
if (added_magicline)
remove_magicline();

View File

@ -392,7 +392,7 @@ void extract_buffer(filestruct **file_top, filestruct **file_bot,
/* Renumber, starting with the beginning line of the old partition. */
renumber(top_save);
/* If the text doesn't end with a magicline, and it should, add one. */
/* If the text doesn't end with a newline, and it should, add one. */
if (!ISSET(NO_NEWLINES) && openfile->filebot->data[0] != '\0')
new_magicline();
}
@ -489,7 +489,7 @@ void ingraft_buffer(filestruct *somebuffer)
/* Renumber, starting with the beginning line of the old partition. */
renumber(top_save);
/* If the text doesn't end with a magicline, and it should, add one. */
/* If the text doesn't end with a newline, and it should, add one. */
if (!ISSET(NO_NEWLINES) && openfile->filebot->data[0] != '\0')
new_magicline();
}
@ -1902,7 +1902,7 @@ void do_output(char *output, size_t output_len, bool allow_cntrls)
update_undo(ADD);
#endif
/* If we've added text to the magicline, create a new magicline. */
/* If we've added text to the magic line, create a new magic line. */
if (openfile->filebot == openfile->current && !ISSET(NO_NEWLINES)) {
new_magicline();
if (margin > 0)

View File

@ -680,7 +680,7 @@ ssize_t do_replace_loop(const char *needle, bool whole_word_only,
#endif
/* If "automatic newline" is enabled, and text has been added to the
* magicline, make a new magicline. */
* magic line, make a new magic line. */
if (!ISSET(NO_NEWLINES) && openfile->filebot->data[0] != '\0')
new_magicline();

View File

@ -479,7 +479,7 @@ void undo_cut(undo *u)
copy_from_buffer(u->cutbuffer);
/* If the final line was originally cut, remove the extra magicline. */
/* If the final line was originally cut, remove the extra magic line. */
if ((u->xflags & WAS_FINAL_LINE) && !ISSET(NO_NEWLINES) &&
openfile->current != openfile->filebot)
remove_magicline();

View File

@ -437,7 +437,7 @@ size_t strlenpt(const char *text)
return span;
}
/* Append a new magicline to the end of the buffer. */
/* Append a new magic line to the end of the buffer. */
void new_magicline(void)
{
openfile->filebot->next = make_new_node(openfile->filebot);
@ -447,7 +447,7 @@ void new_magicline(void)
}
#if !defined(NANO_TINY) || defined(ENABLE_HELP)
/* Remove the magicline from the end of the buffer, if there is one and
/* Remove the magic line from the end of the buffer, if there is one and
* it isn't the only line in the file. */
void remove_magicline(void)
{