2015-11-02 Benno Schulenberg <bensberg@justemail.net>
* src/nano.h: Delete an unused type definition.
* src/nano.h: Improve several comments.
- * src_text.c(do_wrap): Elide two variables.
+ * src/text.c (do_wrap): Elide two variables.
+ * src/cut.c (do_cut_text): Chop the 'undoing' parameter, so that the
+ calls of this function become more symmetrical.
2015-10-31 Benno Schulenberg <bensberg@justemail.net>
* src/nano.c (copy_from_filestruct): When pasting while the mark is
* position to the end of the file into the cutbuffer. */
void do_cut_text(
#ifndef NANO_TINY
- bool copy_text, bool cut_till_eof, bool undoing
+ bool copy_text, bool cut_till_eof
#else
void
#endif
* disturbing the text. */
if (!old_no_newlines)
UNSET(NO_NEWLINES);
- } else if (!undoing)
- update_undo(cut_till_eof ? CUT_EOF : CUT);
+ }
/* Leave the text in the cutbuffer, and mark the file as
* modified. */
{
#ifndef NANO_TINY
add_undo(CUT);
+ do_cut_text(FALSE, FALSE);
+ update_undo(CUT);
+#else
+ do_cut_text();
#endif
- do_cut_text(
-#ifndef NANO_TINY
- FALSE, FALSE, FALSE
-#endif
- );
}
#ifndef NANO_TINY
if (mark_set || openfile->current != next_contiguous_line)
cutbuffer_reset();
- do_cut_text(TRUE, FALSE, FALSE);
+ do_cut_text(TRUE, FALSE);
/* If the mark was set, blow away the cutbuffer on the next copy. */
next_contiguous_line = (mark_set ? NULL : openfile->current);
void do_cut_till_eof(void)
{
add_undo(CUT_EOF);
- do_cut_text(FALSE, TRUE, FALSE);
+ do_cut_text(FALSE, TRUE);
+ update_undo(CUT_EOF);
}
#endif /* !NANO_TINY */
#endif
void do_cut_text(
#ifndef NANO_TINY
- bool copy_text, bool cut_till_eof, bool undoing
+ bool copy_text, bool cut_till_eof
#else
void
#endif
openfile->mark_begin = fsfromline(u->mark_begin_lineno);
openfile->mark_begin_x = (u->xflags == WAS_WHOLE_LINE) ? 0 : u->mark_begin_x;
- do_cut_text(FALSE, FALSE, TRUE);
+ do_cut_text(FALSE, FALSE);
openfile->mark_set = FALSE;
openfile->mark_begin = NULL;