commit 1e2d9a697a5dac99bca159efb263c269c6461aa4
parent 63c428ad08e83c43994f5360ccec327036e9ec96
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Fri, 14 Jul 2017 16:14:02 +0200
tweaks: rename a constant, to match the corresponding option
Diffstat:
7 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/src/cut.c b/src/cut.c
@@ -155,7 +155,7 @@ void do_cut_text(bool copy_text, bool cut_till_eof)
/* Move the marked text to the cutbuffer, and turn the mark off. */
cut_marked(&right_side_up);
openfile->mark_set = FALSE;
- } else if (ISSET(CUT_TO_END))
+ } else if (ISSET(CUT_FROM_CURSOR))
/* Move all text up to the end of the line into the cutbuffer. */
cut_to_eol();
else
diff --git a/src/global.c b/src/global.c
@@ -1204,7 +1204,7 @@ void shortcut_init(void)
/* Group of "Editing-behavior" toggles. */
add_to_sclist(MMAIN, "M-H", 0, do_toggle_void, SMART_HOME);
add_to_sclist(MMAIN, "M-I", 0, do_toggle_void, AUTOINDENT);
- add_to_sclist(MMAIN, "M-K", 0, do_toggle_void, CUT_TO_END);
+ add_to_sclist(MMAIN, "M-K", 0, do_toggle_void, CUT_FROM_CURSOR);
#ifndef DISABLE_WRAPPING
add_to_sclist(MMAIN, "M-L", 0, do_toggle_void, NO_WRAP);
#endif
@@ -1376,7 +1376,7 @@ const char *flagtostr(int flag)
return N_("Smart home key");
case AUTOINDENT:
return N_("Auto indent");
- case CUT_TO_END:
+ case CUT_FROM_CURSOR:
return N_("Cut to end");
case NO_WRAP:
return N_("Hard wrapping of overlong lines");
@@ -1635,7 +1635,7 @@ sc *strtosc(const char *input)
else if (!strcasecmp(input, "autoindent"))
s->toggle = AUTOINDENT;
else if (!strcasecmp(input, "cuttoend"))
- s->toggle = CUT_TO_END;
+ s->toggle = CUT_FROM_CURSOR;
#ifndef DISABLE_WRAPPING
else if (!strcasecmp(input, "nowrap"))
s->toggle = NO_WRAP;
diff --git a/src/nano.c b/src/nano.c
@@ -1687,7 +1687,7 @@ int do_input(bool allow_funcs)
#ifndef NANO_TINY
if (s->scfunc == do_toggle_void) {
do_toggle(s->toggle);
- if (s->toggle != CUT_TO_END)
+ if (s->toggle != CUT_FROM_CURSOR)
preserve = TRUE;
} else
#endif
@@ -2150,7 +2150,7 @@ int main(int argc, char **argv)
SET(AUTOINDENT);
break;
case 'k':
- SET(CUT_TO_END);
+ SET(CUT_FROM_CURSOR);
break;
#endif
#ifdef ENABLE_MOUSE
diff --git a/src/nano.h b/src/nano.h
@@ -489,7 +489,7 @@ enum
USE_MOUSE,
USE_REGEXP,
TEMP_FILE,
- CUT_TO_END,
+ CUT_FROM_CURSOR,
BACKWARDS_SEARCH,
MULTIBUFFER,
SMOOTH_SCROLL,
diff --git a/src/prompt.c b/src/prompt.c
@@ -291,7 +291,7 @@ void do_statusbar_delete(void)
/* Zap some or all text from the answer. */
void do_statusbar_cut_text(void)
{
- if (!ISSET(CUT_TO_END))
+ if (!ISSET(CUT_FROM_CURSOR))
statusbar_x = 0;
answer[statusbar_x] = '\0';
diff --git a/src/rcfile.c b/src/rcfile.c
@@ -96,8 +96,8 @@ static const rcoption rcopts[] = {
{"backupdir", 0},
{"backwards", BACKWARDS_SEARCH},
{"casesensitive", CASE_SENSITIVE},
- {"cut", CUT_TO_END}, /* deprecated form, remove in 2020 */
- {"cutfromcursor", CUT_TO_END},
+ {"cut", CUT_FROM_CURSOR}, /* deprecated form, remove in 2020 */
+ {"cutfromcursor", CUT_FROM_CURSOR},
{"justifytrim", JUSTIFY_TRIM},
{"locking", LOCKING},
{"matchbrackets", 0},
diff --git a/src/text.c b/src/text.c
@@ -1270,7 +1270,7 @@ void add_undo(undo_type action)
u->mark_begin_lineno = openfile->mark_begin->lineno;
u->mark_begin_x = openfile->mark_begin_x;
u->xflags = MARK_WAS_SET;
- } else if (!ISSET(CUT_TO_END)) {
+ } else if (!ISSET(CUT_FROM_CURSOR)) {
/* The entire line is being cut regardless of the cursor position. */
u->begin = 0;
u->xflags = WAS_WHOLE_LINE;
@@ -1423,7 +1423,7 @@ fprintf(stderr, " >> Updating... action = %d, openfile->last_action = %d, openf
u->cutbottom = u->cutbottom->next;
u->lineno = u->mark_begin_lineno + u->cutbottom->lineno -
u->cutbuffer->lineno;
- if (ISSET(CUT_TO_END) || u->type == CUT_EOF) {
+ if (ISSET(CUT_FROM_CURSOR) || u->type == CUT_EOF) {
u->begin = strlen(u->cutbottom->data);
if (u->lineno == u->mark_begin_lineno)
u->begin += u->mark_begin_x;