tweaks: rename two functions, to be simpler

master
Benno Schulenberg 2019-05-03 19:47:08 +02:00
parent edf6995be4
commit 954c4d03ac
6 changed files with 16 additions and 16 deletions

View File

@ -398,7 +398,7 @@ void do_cut_text_void(void)
/* Move text from the current buffer into the cutbuffer, and copy it
* back into the buffer afterward. If the mark is set or the cursor
* was moved, blow away previous contents of the cutbuffer. */
void do_copy_text(void)
void copy_text(void)
{
bool mark_is_set = (openfile->mark != NULL);
@ -467,7 +467,7 @@ void zap_text(void)
#endif /* !NANO_TINY */
/* Copy text from the cutbuffer into the current buffer. */
void do_uncut_text(void)
void paste_text(void)
{
ssize_t was_lineno = openfile->current->lineno;
/* The line number where we started the paste. */

View File

@ -764,7 +764,7 @@ void shortcut_init(void)
add_to_funcs(do_cut_text_void, MMAIN,
N_("Cut Text"), WITHORSANS(cut_gist), TOGETHER, NOVIEW);
add_to_funcs(do_uncut_text, MMAIN,
add_to_funcs(paste_text, MMAIN,
N_("Paste Text"), WITHORSANS(uncut_gist), BLANKAFTER, NOVIEW);
if (!ISSET(RESTRICTED)) {
@ -797,7 +797,7 @@ void shortcut_init(void)
add_to_funcs(do_mark, MMAIN,
N_("Mark Text"), WITHORSANS(mark_gist), TOGETHER, VIEW);
add_to_funcs(do_copy_text, MMAIN,
add_to_funcs(copy_text, MMAIN,
N_("Copy Text"), WITHORSANS(copy_gist), BLANKAFTER, NOVIEW);
#endif
@ -1115,7 +1115,7 @@ void shortcut_init(void)
add_to_sclist(MMAIN, "^\\", 0, do_replace, 0);
add_to_sclist(MMAIN, "M-R", 0, do_replace, 0);
add_to_sclist(MMOST, "^K", 0, do_cut_text_void, 0);
add_to_sclist(MMOST, "^U", 0, do_uncut_text, 0);
add_to_sclist(MMOST, "^U", 0, paste_text, 0);
#ifdef ENABLE_JUSTIFY
add_to_sclist(MMAIN, "^J", 0, do_justify_void, 0);
#endif
@ -1146,8 +1146,8 @@ void shortcut_init(void)
add_to_sclist(MMAIN, "M-A", 0, do_mark, 0);
add_to_sclist(MMAIN, "^6", 0, do_mark, 0);
add_to_sclist(MMAIN, "^^", 0, do_mark, 0);
add_to_sclist(MMAIN, "M-6", 0, do_copy_text, 0);
add_to_sclist(MMAIN, "M-^", 0, do_copy_text, 0);
add_to_sclist(MMAIN, "M-6", 0, copy_text, 0);
add_to_sclist(MMAIN, "M-^", 0, copy_text, 0);
add_to_sclist(MMAIN, "M-}", 0, do_indent, 0);
add_to_sclist(MMAIN, "Tab", TAB_CODE, do_indent, 0);
add_to_sclist(MMAIN, "M-{", 0, do_unindent, 0);
@ -1384,7 +1384,7 @@ void shortcut_init(void)
add_to_sclist(MMAIN|MHELP|MBROWSER|MLINTER, "F7", 0, do_page_up, 0);
add_to_sclist(MMAIN|MHELP|MBROWSER|MLINTER, "F8", 0, do_page_down, 0);
add_to_sclist(MMOST, "F9", 0, do_cut_text_void, 0);
add_to_sclist(MMOST, "F10", 0, do_uncut_text, 0);
add_to_sclist(MMOST, "F10", 0, paste_text, 0);
add_to_sclist(MMAIN, "F11", 0, do_cursorpos_void, 0);
#ifdef ENABLE_SPELLER
add_to_sclist(MMAIN, "F12", 0, do_spell, 0);
@ -1485,12 +1485,12 @@ keystruct *strtosc(const char *input)
else if (!strcasecmp(input, "cut"))
s->func = do_cut_text_void;
else if (!strcasecmp(input, "paste"))
s->func = do_uncut_text;
s->func = paste_text;
#ifndef NANO_TINY
else if (!strcasecmp(input, "cutrestoffile"))
s->func = do_cut_till_eof;
else if (!strcasecmp(input, "copy"))
s->func = do_copy_text;
s->func = copy_text;
else if (!strcasecmp(input, "zap"))
s->func = zap_text;
else if (!strcasecmp(input, "mark"))

View File

@ -1723,7 +1723,7 @@ void do_input(void)
/* When not cutting or copying text, drop the cutbuffer the next time. */
if (shortcut->func != do_cut_text_void) {
#ifndef NANO_TINY
if (shortcut->func != do_copy_text && shortcut->func != zap_text)
if (shortcut->func != copy_text && shortcut->func != zap_text)
#endif
keep_cutbuffer = FALSE;
}

View File

@ -151,7 +151,7 @@ int do_statusbar_input(bool *finished)
openfile->filename[0] != '\0' &&
(shortcut->func == do_verbatim_input ||
shortcut->func == do_cut_text_void ||
shortcut->func == do_uncut_text ||
shortcut->func == paste_text ||
shortcut->func == do_delete ||
shortcut->func == do_backspace))
;
@ -167,7 +167,7 @@ int do_statusbar_input(bool *finished)
do_statusbar_delete();
else if (shortcut->func == do_backspace)
do_statusbar_backspace();
else if (shortcut->func == do_uncut_text) {
else if (shortcut->func == paste_text) {
if (cutbuffer != NULL)
do_statusbar_uncut_text();
} else {

View File

@ -258,11 +258,11 @@ void do_cut_text(bool copying, bool marked, bool until_eof, bool append);
bool is_cuttable(bool test_cliff);
void do_cut_text_void(void);
#ifndef NANO_TINY
void do_copy_text(void);
void copy_text(void);
void do_cut_till_eof(void);
void zap_text(void);
#endif
void do_uncut_text(void);
void paste_text(void);
/* Most functions in files.c. */
void initialize_buffer_text(void);

View File

@ -338,7 +338,7 @@ bool is_universal(void (*func)(void))
func == do_prev_word_void || func == do_next_word_void ||
#endif
func == do_delete || func == do_backspace ||
func == do_cut_text_void || func == do_uncut_text ||
func == do_cut_text_void || func == paste_text ||
func == do_tab || func == do_enter || func == do_verbatim_input);
}