tweaks: rename three functions and two symbols, to match the new wording

master
Benno Schulenberg 2019-02-24 17:27:22 +01:00
parent 2c7d336711
commit b5ca8a00af
3 changed files with 19 additions and 19 deletions

View File

@ -142,8 +142,8 @@ void do_backspace(void)
#ifndef NANO_TINY #ifndef NANO_TINY
/* Delete text from the cursor until the first start of a word to /* Delete text from the cursor until the first start of a word to
* the right, or to the left when backward is true. */ * the left, or to the right when forward is TRUE. */
void do_cutword(bool backward) void chop_word(bool forward)
{ {
/* Remember the current cursor position. */ /* Remember the current cursor position. */
filestruct *is_current = openfile->current; filestruct *is_current = openfile->current;
@ -159,7 +159,7 @@ void do_cutword(bool backward)
* If that word is on another line and the cursor was not already * If that word is on another line and the cursor was not already
* on the edge of the original line, then put the cursor on that * on the edge of the original line, then put the cursor on that
* edge instead, so that lines will not be joined unexpectedly. */ * edge instead, so that lines will not be joined unexpectedly. */
if (backward) { if (!forward) {
do_prev_word(ISSET(WORD_BOUNDS)); do_prev_word(ISSET(WORD_BOUNDS));
if (openfile->current != is_current) { if (openfile->current != is_current) {
if (is_current_x > 0) { if (is_current_x > 0) {
@ -195,16 +195,16 @@ void do_cutword(bool backward)
} }
/* Delete a word leftward. */ /* Delete a word leftward. */
void do_cut_prev_word(void) void chop_previous_word(void)
{ {
do_cutword(TRUE); chop_word(BACKWARD);
} }
/* Delete a word rightward. */ /* Delete a word rightward. */
void do_cut_next_word(void) void chop_next_word(void)
{ {
if (is_cuttable(openfile->current_x > 0)) if (is_cuttable(openfile->current_x > 0))
do_cutword(FALSE); chop_word(FORWARD);
} }
#endif /* !NANO_TINY */ #endif /* !NANO_TINY */

View File

@ -611,9 +611,9 @@ void shortcut_init(void)
const char *backspace_gist = const char *backspace_gist =
N_("Delete the character to the left of the cursor"); N_("Delete the character to the left of the cursor");
#ifndef NANO_TINY #ifndef NANO_TINY
const char *cutwordleft_gist = const char *chopwordleft_gist =
N_("Delete backward from cursor to word start"); N_("Delete backward from cursor to word start");
const char *cutwordright_gist = const char *chopwordright_gist =
N_("Delete forward from cursor to next word start"); N_("Delete forward from cursor to next word start");
const char *cuttilleof_gist = const char *cuttilleof_gist =
N_("Cut from the cursor position to the end of the file"); N_("Cut from the cursor position to the end of the file");
@ -942,11 +942,11 @@ void shortcut_init(void)
NOVIEW); NOVIEW);
#ifndef NANO_TINY #ifndef NANO_TINY
add_to_funcs(do_cut_prev_word, MMAIN, add_to_funcs(chop_previous_word, MMAIN,
/* TRANSLATORS: The next two strings refer to deleting words. */ /* TRANSLATORS: The next two strings refer to deleting words. */
N_("Chop Left"), WITHORSANS(cutwordleft_gist), TOGETHER, NOVIEW); N_("Chop Left"), WITHORSANS(chopwordleft_gist), TOGETHER, NOVIEW);
add_to_funcs(do_cut_next_word, MMAIN, add_to_funcs(chop_next_word, MMAIN,
N_("Chop Right"), WITHORSANS(cutwordright_gist), TOGETHER, NOVIEW); N_("Chop Right"), WITHORSANS(chopwordright_gist), TOGETHER, NOVIEW);
add_to_funcs(do_cut_till_eof, MMAIN, add_to_funcs(do_cut_till_eof, MMAIN,
N_("CutTillEnd"), WITHORSANS(cuttilleof_gist), BLANKAFTER, NOVIEW); N_("CutTillEnd"), WITHORSANS(cuttilleof_gist), BLANKAFTER, NOVIEW);
#endif #endif
@ -1151,8 +1151,8 @@ void shortcut_init(void)
add_to_sclist(MMAIN, "M-;", 0, run_macro, 0); add_to_sclist(MMAIN, "M-;", 0, run_macro, 0);
add_to_sclist(MMAIN, "M-U", 0, do_undo, 0); add_to_sclist(MMAIN, "M-U", 0, do_undo, 0);
add_to_sclist(MMAIN, "M-E", 0, do_redo, 0); add_to_sclist(MMAIN, "M-E", 0, do_redo, 0);
add_to_sclist(MMAIN, "Sh-^Del", CONTROL_SHIFT_DELETE, do_cut_prev_word, 0); add_to_sclist(MMAIN, "Sh-^Del", CONTROL_SHIFT_DELETE, chop_previous_word, 0);
add_to_sclist(MMAIN, "^Del", CONTROL_DELETE, do_cut_next_word, 0); add_to_sclist(MMAIN, "^Del", CONTROL_DELETE, chop_next_word, 0);
add_to_sclist(MMAIN, "M-Del", ALT_DELETE, zap_text, 0); add_to_sclist(MMAIN, "M-Del", ALT_DELETE, zap_text, 0);
#endif #endif
#ifdef ENABLE_WORDCOMPLETION #ifdef ENABLE_WORDCOMPLETION
@ -1521,10 +1521,10 @@ sc *strtosc(const char *input)
s->func = do_unindent; s->func = do_unindent;
else if (!strcasecmp(input, "chopwordleft") || else if (!strcasecmp(input, "chopwordleft") ||
!strcasecmp(input, "cutwordleft")) /* Deprecated; remove in 2020. */ !strcasecmp(input, "cutwordleft")) /* Deprecated; remove in 2020. */
s->func = do_cut_prev_word; s->func = chop_previous_word;
else if (!strcasecmp(input, "chopwordright") || else if (!strcasecmp(input, "chopwordright") ||
!strcasecmp(input, "cutwordright")) /* Deprecated; remove in 2020. */ !strcasecmp(input, "cutwordright")) /* Deprecated; remove in 2020. */
s->func = do_cut_next_word; s->func = chop_next_word;
else if (!strcasecmp(input, "findbracket")) else if (!strcasecmp(input, "findbracket"))
s->func = do_find_bracket; s->func = do_find_bracket;
else if (!strcasecmp(input, "wordcount")) else if (!strcasecmp(input, "wordcount"))

View File

@ -246,8 +246,8 @@ void precalc_multicolorinfo(void);
void do_delete(void); void do_delete(void);
void do_backspace(void); void do_backspace(void);
#ifndef NANO_TINY #ifndef NANO_TINY
void do_cut_prev_word(void); void chop_previous_word(void);
void do_cut_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 copy_text, bool marked, bool cut_till_eof, bool append); void do_cut_text(bool copy_text, bool marked, bool cut_till_eof, bool append);