mirror of
git://git.sv.gnu.org/nano.git
synced 2024-11-29 16:13:27 +03:00
tweaks: rename three functions and two symbols, to match the new wording
This commit is contained in:
parent
2c7d336711
commit
b5ca8a00af
14
src/cut.c
14
src/cut.c
@ -142,8 +142,8 @@ void do_backspace(void)
|
||||
|
||||
#ifndef NANO_TINY
|
||||
/* Delete text from the cursor until the first start of a word to
|
||||
* the right, or to the left when backward is true. */
|
||||
void do_cutword(bool backward)
|
||||
* the left, or to the right when forward is TRUE. */
|
||||
void chop_word(bool forward)
|
||||
{
|
||||
/* Remember the current cursor position. */
|
||||
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
|
||||
* on the edge of the original line, then put the cursor on that
|
||||
* edge instead, so that lines will not be joined unexpectedly. */
|
||||
if (backward) {
|
||||
if (!forward) {
|
||||
do_prev_word(ISSET(WORD_BOUNDS));
|
||||
if (openfile->current != is_current) {
|
||||
if (is_current_x > 0) {
|
||||
@ -195,16 +195,16 @@ void do_cutword(bool backward)
|
||||
}
|
||||
|
||||
/* 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. */
|
||||
void do_cut_next_word(void)
|
||||
void chop_next_word(void)
|
||||
{
|
||||
if (is_cuttable(openfile->current_x > 0))
|
||||
do_cutword(FALSE);
|
||||
chop_word(FORWARD);
|
||||
}
|
||||
#endif /* !NANO_TINY */
|
||||
|
||||
|
20
src/global.c
20
src/global.c
@ -611,9 +611,9 @@ void shortcut_init(void)
|
||||
const char *backspace_gist =
|
||||
N_("Delete the character to the left of the cursor");
|
||||
#ifndef NANO_TINY
|
||||
const char *cutwordleft_gist =
|
||||
const char *chopwordleft_gist =
|
||||
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");
|
||||
const char *cuttilleof_gist =
|
||||
N_("Cut from the cursor position to the end of the file");
|
||||
@ -942,11 +942,11 @@ void shortcut_init(void)
|
||||
NOVIEW);
|
||||
|
||||
#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. */
|
||||
N_("Chop Left"), WITHORSANS(cutwordleft_gist), TOGETHER, NOVIEW);
|
||||
add_to_funcs(do_cut_next_word, MMAIN,
|
||||
N_("Chop Right"), WITHORSANS(cutwordright_gist), TOGETHER, NOVIEW);
|
||||
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,
|
||||
N_("CutTillEnd"), WITHORSANS(cuttilleof_gist), BLANKAFTER, NOVIEW);
|
||||
#endif
|
||||
@ -1151,8 +1151,8 @@ void shortcut_init(void)
|
||||
add_to_sclist(MMAIN, "M-;", 0, run_macro, 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, "Sh-^Del", CONTROL_SHIFT_DELETE, do_cut_prev_word, 0);
|
||||
add_to_sclist(MMAIN, "^Del", CONTROL_DELETE, do_cut_next_word, 0);
|
||||
add_to_sclist(MMAIN, "Sh-^Del", CONTROL_SHIFT_DELETE, chop_previous_word, 0);
|
||||
add_to_sclist(MMAIN, "^Del", CONTROL_DELETE, chop_next_word, 0);
|
||||
add_to_sclist(MMAIN, "M-Del", ALT_DELETE, zap_text, 0);
|
||||
#endif
|
||||
#ifdef ENABLE_WORDCOMPLETION
|
||||
@ -1521,10 +1521,10 @@ sc *strtosc(const char *input)
|
||||
s->func = do_unindent;
|
||||
else if (!strcasecmp(input, "chopwordleft") ||
|
||||
!strcasecmp(input, "cutwordleft")) /* Deprecated; remove in 2020. */
|
||||
s->func = do_cut_prev_word;
|
||||
s->func = chop_previous_word;
|
||||
else if (!strcasecmp(input, "chopwordright") ||
|
||||
!strcasecmp(input, "cutwordright")) /* Deprecated; remove in 2020. */
|
||||
s->func = do_cut_next_word;
|
||||
s->func = chop_next_word;
|
||||
else if (!strcasecmp(input, "findbracket"))
|
||||
s->func = do_find_bracket;
|
||||
else if (!strcasecmp(input, "wordcount"))
|
||||
|
@ -246,8 +246,8 @@ void precalc_multicolorinfo(void);
|
||||
void do_delete(void);
|
||||
void do_backspace(void);
|
||||
#ifndef NANO_TINY
|
||||
void do_cut_prev_word(void);
|
||||
void do_cut_next_word(void);
|
||||
void chop_previous_word(void);
|
||||
void chop_next_word(void);
|
||||
void cut_marked(bool *right_side_up);
|
||||
#endif
|
||||
void do_cut_text(bool copy_text, bool marked, bool cut_till_eof, bool append);
|
||||
|
Loading…
Reference in New Issue
Block a user