From 8720cfcce9ecb874e3701301ee9e41f9346be574 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Fri, 3 May 2019 19:51:15 +0200 Subject: [PATCH] tweaks: rename two more functions, to be simpler too --- src/cut.c | 6 +++--- src/global.c | 14 +++++++------- src/nano.c | 2 +- src/prompt.c | 4 ++-- src/proto.h | 4 ++-- src/rcfile.c | 2 +- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/cut.c b/src/cut.c index d0c90311..a74c68dc 100644 --- a/src/cut.c +++ b/src/cut.c @@ -184,7 +184,7 @@ void chop_word(bool forward) openfile->current_x = is_current_x; /* Now kill the marked region and a word is gone. */ - do_cut_text_void(); + cut_text(); /* Discard the cut word and restore the cutbuffer. */ free_lines(cutbuffer); @@ -372,7 +372,7 @@ bool is_cuttable(bool test_cliff) } /* Move text from the current buffer into the cutbuffer. */ -void do_cut_text_void(void) +void cut_text(void) { #ifndef NANO_TINY if (!is_cuttable(ISSET(CUT_FROM_CURSOR) && openfile->mark == NULL)) @@ -427,7 +427,7 @@ void copy_text(void) } /* Cut from the current cursor position to the end of the file. */ -void do_cut_till_eof(void) +void cut_till_eof(void) { if ((openfile->current == openfile->filebot && openfile->current->data[0] == '\0') || (!ISSET(NO_NEWLINES) && openfile->current->next == openfile->filebot && diff --git a/src/global.c b/src/global.c index 0364eee0..f8c529ab 100644 --- a/src/global.c +++ b/src/global.c @@ -761,7 +761,7 @@ void shortcut_init(void) N_("Refresh"), WITHORSANS(browserrefresh_gist), BLANKAFTER, VIEW); #endif - add_to_funcs(do_cut_text_void, MMAIN, + add_to_funcs(cut_text, MMAIN, N_("Cut Text"), WITHORSANS(cut_gist), TOGETHER, NOVIEW); add_to_funcs(paste_text, MMAIN, @@ -952,7 +952,7 @@ void shortcut_init(void) N_("Chop Left"), WITHORSANS(chopwordleft_gist), TOGETHER, NOVIEW); add_to_funcs(chop_next_word, MMAIN, N_("Chop Right"), WITHORSANS(chopwordright_gist), TOGETHER, NOVIEW); - add_to_funcs(do_cut_till_eof, MMAIN, + add_to_funcs(cut_till_eof, MMAIN, N_("CutTillEnd"), WITHORSANS(cuttilleof_gist), BLANKAFTER, NOVIEW); #endif @@ -1114,7 +1114,7 @@ void shortcut_init(void) add_to_sclist(MMAIN|MHELP|MBROWSER, "^W", 0, do_search_forward, 0); 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, "^K", 0, cut_text, 0); add_to_sclist(MMOST, "^U", 0, paste_text, 0); #ifdef ENABLE_JUSTIFY add_to_sclist(MMAIN, "^J", 0, do_justify_void, 0); @@ -1244,7 +1244,7 @@ void shortcut_init(void) #endif add_to_sclist(MMOST, "M-V", 0, do_verbatim_input, 0); #ifndef NANO_TINY - add_to_sclist(MMAIN, "M-T", 0, do_cut_till_eof, 0); + add_to_sclist(MMAIN, "M-T", 0, cut_till_eof, 0); add_to_sclist(MMAIN, "M-D", 0, do_wordlinechar_count, 0); #endif #ifdef ENABLE_JUSTIFY @@ -1383,7 +1383,7 @@ void shortcut_init(void) add_to_sclist(MMAIN|MHELP|MBROWSER, "F6", 0, do_search_forward, 0); 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, "F9", 0, cut_text, 0); add_to_sclist(MMOST, "F10", 0, paste_text, 0); add_to_sclist(MMAIN, "F11", 0, do_cursorpos_void, 0); #ifdef ENABLE_SPELLER @@ -1483,12 +1483,12 @@ keystruct *strtosc(const char *input) else if (!strcasecmp(input, "replace")) s->func = do_replace; else if (!strcasecmp(input, "cut")) - s->func = do_cut_text_void; + s->func = cut_text; else if (!strcasecmp(input, "paste")) s->func = paste_text; #ifndef NANO_TINY else if (!strcasecmp(input, "cutrestoffile")) - s->func = do_cut_till_eof; + s->func = cut_till_eof; else if (!strcasecmp(input, "copy")) s->func = copy_text; else if (!strcasecmp(input, "zap")) diff --git a/src/nano.c b/src/nano.c index 01cfb62e..72c38f5f 100644 --- a/src/nano.c +++ b/src/nano.c @@ -1721,7 +1721,7 @@ void do_input(void) } /* When not cutting or copying text, drop the cutbuffer the next time. */ - if (shortcut->func != do_cut_text_void) { + if (shortcut->func != cut_text) { #ifndef NANO_TINY if (shortcut->func != copy_text && shortcut->func != zap_text) #endif diff --git a/src/prompt.c b/src/prompt.c index 8a8d4dc2..953330a9 100644 --- a/src/prompt.c +++ b/src/prompt.c @@ -150,7 +150,7 @@ int do_statusbar_input(bool *finished) else if (ISSET(RESTRICTED) && currmenu == MWRITEFILE && openfile->filename[0] != '\0' && (shortcut->func == do_verbatim_input || - shortcut->func == do_cut_text_void || + shortcut->func == cut_text || shortcut->func == paste_text || shortcut->func == do_delete || shortcut->func == do_backspace)) @@ -161,7 +161,7 @@ int do_statusbar_input(bool *finished) #endif else if (shortcut->func == do_verbatim_input) do_statusbar_verbatim_input(); - else if (shortcut->func == do_cut_text_void) + else if (shortcut->func == cut_text) do_statusbar_cut_text(); else if (shortcut->func == do_delete) do_statusbar_delete(); diff --git a/src/proto.h b/src/proto.h index 410d7a4d..73fde01b 100644 --- a/src/proto.h +++ b/src/proto.h @@ -256,10 +256,10 @@ void cut_marked(bool *right_side_up); #endif 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); +void cut_text(void); #ifndef NANO_TINY void copy_text(void); -void do_cut_till_eof(void); +void cut_till_eof(void); void zap_text(void); #endif void paste_text(void); diff --git a/src/rcfile.c b/src/rcfile.c index 25ffa40f..95a60833 100644 --- a/src/rcfile.c +++ b/src/rcfile.c @@ -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 == paste_text || + func == cut_text || func == paste_text || func == do_tab || func == do_enter || func == do_verbatim_input); }