Commit f74a1208 authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

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

No related merge requests found
Showing with 12 additions and 14 deletions
+12 -14
...@@ -309,7 +309,7 @@ void do_cut_text(bool copy_text, bool marked, bool cut_till_eof, bool append) ...@@ -309,7 +309,7 @@ void do_cut_text(bool copy_text, bool marked, bool cut_till_eof, bool append)
cb_save = cutbottom; cb_save = cutbottom;
cb_save_len = strlen(cutbottom->data); 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); SET(NO_NEWLINES);
} }
...@@ -346,7 +346,7 @@ void do_cut_text(bool copy_text, bool marked, bool cut_till_eof, bool append) ...@@ -346,7 +346,7 @@ void do_cut_text(bool copy_text, bool marked, bool cut_till_eof, bool append)
if (right_side_up) if (right_side_up)
openfile->placewewant = xplustabs(); 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) if (!old_no_newlines)
UNSET(NO_NEWLINES); UNSET(NO_NEWLINES);
} else } else
......
...@@ -565,7 +565,7 @@ void replace_marked_buffer(const char *filename) ...@@ -565,7 +565,7 @@ void replace_marked_buffer(const char *filename)
if (descriptor < 0) if (descriptor < 0)
return; 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); SET(NO_NEWLINES);
add_undo(COUPLE_BEGIN); add_undo(COUPLE_BEGIN);
...@@ -582,7 +582,7 @@ void replace_marked_buffer(const char *filename) ...@@ -582,7 +582,7 @@ void replace_marked_buffer(const char *filename)
/* Insert the processed file where the marked text was. */ /* Insert the processed file where the marked text was. */
read_file(f, descriptor, filename, TRUE); 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) if (!old_no_newlines)
UNSET(NO_NEWLINES); UNSET(NO_NEWLINES);
...@@ -2049,7 +2049,6 @@ bool write_marked_file(const char *name, FILE *f_open, bool tmp, ...@@ -2049,7 +2049,6 @@ bool write_marked_file(const char *name, FILE *f_open, bool tmp,
{ {
bool retval; bool retval;
bool added_magicline = FALSE; bool added_magicline = FALSE;
/* Whether we added a magicline after filebot. */
filestruct *top, *bot; filestruct *top, *bot;
size_t top_x, bot_x; size_t top_x, bot_x;
...@@ -2058,7 +2057,7 @@ bool write_marked_file(const char *name, FILE *f_open, bool tmp, ...@@ -2058,7 +2057,7 @@ bool write_marked_file(const char *name, FILE *f_open, bool tmp,
(const filestruct **)&bot, &bot_x, NULL); (const filestruct **)&bot, &bot_x, NULL);
filepart = partition_filestruct(top, top_x, bot, bot_x); 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. */ * isn't blank, then add a newline at the end of the buffer. */
if (!ISSET(NO_NEWLINES) && openfile->filebot->data[0] != '\0') { if (!ISSET(NO_NEWLINES) && openfile->filebot->data[0] != '\0') {
new_magicline(); new_magicline();
...@@ -2067,7 +2066,6 @@ bool write_marked_file(const char *name, FILE *f_open, bool tmp, ...@@ -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); retval = write_file(name, f_open, tmp, method, FALSE);
/* If we added a magicline, remove it now. */
if (added_magicline) if (added_magicline)
remove_magicline(); remove_magicline();
......
...@@ -392,7 +392,7 @@ void extract_buffer(filestruct **file_top, filestruct **file_bot, ...@@ -392,7 +392,7 @@ void extract_buffer(filestruct **file_top, filestruct **file_bot,
/* Renumber, starting with the beginning line of the old partition. */ /* Renumber, starting with the beginning line of the old partition. */
renumber(top_save); 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') if (!ISSET(NO_NEWLINES) && openfile->filebot->data[0] != '\0')
new_magicline(); new_magicline();
} }
...@@ -489,7 +489,7 @@ void ingraft_buffer(filestruct *somebuffer) ...@@ -489,7 +489,7 @@ void ingraft_buffer(filestruct *somebuffer)
/* Renumber, starting with the beginning line of the old partition. */ /* Renumber, starting with the beginning line of the old partition. */
renumber(top_save); 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') if (!ISSET(NO_NEWLINES) && openfile->filebot->data[0] != '\0')
new_magicline(); new_magicline();
} }
...@@ -1902,7 +1902,7 @@ void do_output(char *output, size_t output_len, bool allow_cntrls) ...@@ -1902,7 +1902,7 @@ void do_output(char *output, size_t output_len, bool allow_cntrls)
update_undo(ADD); update_undo(ADD);
#endif #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)) { if (openfile->filebot == openfile->current && !ISSET(NO_NEWLINES)) {
new_magicline(); new_magicline();
if (margin > 0) if (margin > 0)
......
...@@ -680,7 +680,7 @@ ssize_t do_replace_loop(const char *needle, bool whole_word_only, ...@@ -680,7 +680,7 @@ ssize_t do_replace_loop(const char *needle, bool whole_word_only,
#endif #endif
/* If "automatic newline" is enabled, and text has been added to the /* 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') if (!ISSET(NO_NEWLINES) && openfile->filebot->data[0] != '\0')
new_magicline(); new_magicline();
......
...@@ -479,7 +479,7 @@ void undo_cut(undo *u) ...@@ -479,7 +479,7 @@ void undo_cut(undo *u)
copy_from_buffer(u->cutbuffer); 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) && if ((u->xflags & WAS_FINAL_LINE) && !ISSET(NO_NEWLINES) &&
openfile->current != openfile->filebot) openfile->current != openfile->filebot)
remove_magicline(); remove_magicline();
......
...@@ -437,7 +437,7 @@ size_t strlenpt(const char *text) ...@@ -437,7 +437,7 @@ size_t strlenpt(const char *text)
return span; 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) void new_magicline(void)
{ {
openfile->filebot->next = make_new_node(openfile->filebot); openfile->filebot->next = make_new_node(openfile->filebot);
...@@ -447,7 +447,7 @@ void new_magicline(void) ...@@ -447,7 +447,7 @@ void new_magicline(void)
} }
#if !defined(NANO_TINY) || defined(ENABLE_HELP) #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. */ * it isn't the only line in the file. */
void remove_magicline(void) void remove_magicline(void)
{ {
......
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