tweaks: make a function name unique, to not overlap with others

master
Benno Schulenberg 2019-08-09 19:34:03 +02:00
parent 0c63b50fdc
commit 63e04ac31e
4 changed files with 12 additions and 12 deletions

View File

@ -183,7 +183,7 @@ void chop_word(bool forward)
/* Now kill the marked region and a word is gone. */ /* Now kill the marked region and a word is gone. */
add_undo(CUT); add_undo(CUT);
do_cut_text(FALSE, TRUE, FALSE, FALSE); do_snip(FALSE, TRUE, FALSE, FALSE);
update_undo(CUT); update_undo(CUT);
/* Discard the cut word and restore the cutbuffer. */ /* Discard the cut word and restore the cutbuffer. */
@ -270,7 +270,7 @@ void cut_to_eof(void)
* If until_eof is TRUE, move all text from the current cursor * If until_eof is TRUE, move all text from the current cursor
* position to the end of the file into the cutbuffer. If append * position to the end of the file into the cutbuffer. If append
* is TRUE (when zapping), always append the cut to the cutbuffer. */ * is TRUE (when zapping), always append the cut to the cutbuffer. */
void do_cut_text(bool copying, bool marked, bool until_eof, bool append) void do_snip(bool copying, bool marked, bool until_eof, bool append)
{ {
#ifndef NANO_TINY #ifndef NANO_TINY
linestruct *was_bottom = NULL; linestruct *was_bottom = NULL;
@ -385,12 +385,12 @@ void cut_text(void)
add_undo(CUT); add_undo(CUT);
} }
do_cut_text(FALSE, openfile->mark != NULL, FALSE, FALSE); do_snip(FALSE, openfile->mark != NULL, FALSE, FALSE);
update_undo(CUT); update_undo(CUT);
#else #else
if (is_cuttable(FALSE)) if (is_cuttable(FALSE))
do_cut_text(FALSE, FALSE, FALSE, FALSE); do_snip(FALSE, FALSE, FALSE, FALSE);
#endif #endif
wipe_statusbar(); wipe_statusbar();
} }
@ -409,7 +409,7 @@ void copy_text(void)
ssize_t is_current_lineno = openfile->current->lineno; ssize_t is_current_lineno = openfile->current->lineno;
size_t is_current_x = openfile->current_x; size_t is_current_x = openfile->current_x;
do_cut_text(TRUE, mark_is_set, FALSE, FALSE); do_snip(TRUE, mark_is_set, FALSE, FALSE);
/* If the mark was set, restore the viewport and cursor position. */ /* If the mark was set, restore the viewport and cursor position. */
if (mark_is_set) { if (mark_is_set) {
@ -434,7 +434,7 @@ void cut_till_eof(void)
} }
add_undo(CUT_TO_EOF); add_undo(CUT_TO_EOF);
do_cut_text(FALSE, FALSE, TRUE, FALSE); do_snip(FALSE, FALSE, TRUE, FALSE);
update_undo(CUT_TO_EOF); update_undo(CUT_TO_EOF);
wipe_statusbar(); wipe_statusbar();
} }
@ -456,7 +456,7 @@ void zap_text(void)
/* Use the cutbuffer from the ZAP undo item, so the cut can be undone. */ /* Use the cutbuffer from the ZAP undo item, so the cut can be undone. */
cutbuffer = openfile->current_undo->cutbuffer; cutbuffer = openfile->current_undo->cutbuffer;
do_cut_text(FALSE, openfile->mark != NULL, FALSE, TRUE); do_snip(FALSE, openfile->mark != NULL, FALSE, TRUE);
update_undo(ZAP); update_undo(ZAP);
wipe_statusbar(); wipe_statusbar();

View File

@ -540,7 +540,7 @@ bool replace_buffer(const char *filename, undo_type action, bool marked)
#ifndef NANO_TINY #ifndef NANO_TINY
add_undo(action); add_undo(action);
#endif #endif
do_cut_text(FALSE, marked, !marked, FALSE); do_snip(FALSE, marked, !marked, FALSE);
#ifndef NANO_TINY #ifndef NANO_TINY
update_undo(action); update_undo(action);
#endif #endif

View File

@ -258,7 +258,7 @@ void chop_previous_word(void);
void chop_next_word(void); void chop_next_word(void);
void cut_marked(bool *right_side_up); void cut_marked(bool *right_side_up);
#endif #endif
void do_cut_text(bool copying, bool marked, bool until_eof, bool append); void do_snip(bool copying, bool marked, bool until_eof, bool append);
bool is_cuttable(bool test_cliff); bool is_cuttable(bool test_cliff);
void cut_text(void); void cut_text(void);
#ifndef NANO_TINY #ifndef NANO_TINY

View File

@ -494,7 +494,7 @@ void redo_cut(undo *u)
openfile->mark = line_from_number(u->mark_begin_lineno); openfile->mark = line_from_number(u->mark_begin_lineno);
openfile->mark_x = (u->xflags & WAS_WHOLE_LINE) ? 0 : u->mark_begin_x; openfile->mark_x = (u->xflags & WAS_WHOLE_LINE) ? 0 : u->mark_begin_x;
do_cut_text(FALSE, TRUE, FALSE, u->type == ZAP); do_snip(FALSE, TRUE, FALSE, u->type == ZAP);
free_lines(cutbuffer); free_lines(cutbuffer);
cutbuffer = oldcutbuffer; cutbuffer = oldcutbuffer;
@ -992,7 +992,7 @@ bool execute_command(const char *command)
if (ISSET(MULTIBUFFER)) { if (ISSET(MULTIBUFFER)) {
openfile = openfile->prev; openfile = openfile->prev;
if (openfile->mark) if (openfile->mark)
do_cut_text(TRUE, TRUE, FALSE, FALSE); do_snip(TRUE, TRUE, FALSE, FALSE);
} else } else
#endif #endif
{ {
@ -1003,7 +1003,7 @@ bool execute_command(const char *command)
openfile->current_x = 0; openfile->current_x = 0;
} }
add_undo(CUT); add_undo(CUT);
do_cut_text(FALSE, openfile->mark != NULL, openfile->mark == NULL, FALSE); do_snip(FALSE, openfile->mark != NULL, openfile->mark == NULL, FALSE);
update_undo(CUT); update_undo(CUT);
} }