tweaks: rename a constant, to match the corresponding option

master
Benno Schulenberg 2017-07-14 16:14:02 +02:00
parent 63c428ad08
commit 1e2d9a697a
7 changed files with 12 additions and 12 deletions

View File

@ -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. */ /* Move the marked text to the cutbuffer, and turn the mark off. */
cut_marked(&right_side_up); cut_marked(&right_side_up);
openfile->mark_set = FALSE; 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. */ /* Move all text up to the end of the line into the cutbuffer. */
cut_to_eol(); cut_to_eol();
else else

View File

@ -1204,7 +1204,7 @@ void shortcut_init(void)
/* Group of "Editing-behavior" toggles. */ /* Group of "Editing-behavior" toggles. */
add_to_sclist(MMAIN, "M-H", 0, do_toggle_void, SMART_HOME); 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-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 #ifndef DISABLE_WRAPPING
add_to_sclist(MMAIN, "M-L", 0, do_toggle_void, NO_WRAP); add_to_sclist(MMAIN, "M-L", 0, do_toggle_void, NO_WRAP);
#endif #endif
@ -1376,7 +1376,7 @@ const char *flagtostr(int flag)
return N_("Smart home key"); return N_("Smart home key");
case AUTOINDENT: case AUTOINDENT:
return N_("Auto indent"); return N_("Auto indent");
case CUT_TO_END: case CUT_FROM_CURSOR:
return N_("Cut to end"); return N_("Cut to end");
case NO_WRAP: case NO_WRAP:
return N_("Hard wrapping of overlong lines"); return N_("Hard wrapping of overlong lines");
@ -1635,7 +1635,7 @@ sc *strtosc(const char *input)
else if (!strcasecmp(input, "autoindent")) else if (!strcasecmp(input, "autoindent"))
s->toggle = AUTOINDENT; s->toggle = AUTOINDENT;
else if (!strcasecmp(input, "cuttoend")) else if (!strcasecmp(input, "cuttoend"))
s->toggle = CUT_TO_END; s->toggle = CUT_FROM_CURSOR;
#ifndef DISABLE_WRAPPING #ifndef DISABLE_WRAPPING
else if (!strcasecmp(input, "nowrap")) else if (!strcasecmp(input, "nowrap"))
s->toggle = NO_WRAP; s->toggle = NO_WRAP;

View File

@ -1687,7 +1687,7 @@ int do_input(bool allow_funcs)
#ifndef NANO_TINY #ifndef NANO_TINY
if (s->scfunc == do_toggle_void) { if (s->scfunc == do_toggle_void) {
do_toggle(s->toggle); do_toggle(s->toggle);
if (s->toggle != CUT_TO_END) if (s->toggle != CUT_FROM_CURSOR)
preserve = TRUE; preserve = TRUE;
} else } else
#endif #endif
@ -2150,7 +2150,7 @@ int main(int argc, char **argv)
SET(AUTOINDENT); SET(AUTOINDENT);
break; break;
case 'k': case 'k':
SET(CUT_TO_END); SET(CUT_FROM_CURSOR);
break; break;
#endif #endif
#ifdef ENABLE_MOUSE #ifdef ENABLE_MOUSE

View File

@ -489,7 +489,7 @@ enum
USE_MOUSE, USE_MOUSE,
USE_REGEXP, USE_REGEXP,
TEMP_FILE, TEMP_FILE,
CUT_TO_END, CUT_FROM_CURSOR,
BACKWARDS_SEARCH, BACKWARDS_SEARCH,
MULTIBUFFER, MULTIBUFFER,
SMOOTH_SCROLL, SMOOTH_SCROLL,

View File

@ -291,7 +291,7 @@ void do_statusbar_delete(void)
/* Zap some or all text from the answer. */ /* Zap some or all text from the answer. */
void do_statusbar_cut_text(void) void do_statusbar_cut_text(void)
{ {
if (!ISSET(CUT_TO_END)) if (!ISSET(CUT_FROM_CURSOR))
statusbar_x = 0; statusbar_x = 0;
answer[statusbar_x] = '\0'; answer[statusbar_x] = '\0';

View File

@ -96,8 +96,8 @@ static const rcoption rcopts[] = {
{"backupdir", 0}, {"backupdir", 0},
{"backwards", BACKWARDS_SEARCH}, {"backwards", BACKWARDS_SEARCH},
{"casesensitive", CASE_SENSITIVE}, {"casesensitive", CASE_SENSITIVE},
{"cut", CUT_TO_END}, /* deprecated form, remove in 2020 */ {"cut", CUT_FROM_CURSOR}, /* deprecated form, remove in 2020 */
{"cutfromcursor", CUT_TO_END}, {"cutfromcursor", CUT_FROM_CURSOR},
{"justifytrim", JUSTIFY_TRIM}, {"justifytrim", JUSTIFY_TRIM},
{"locking", LOCKING}, {"locking", LOCKING},
{"matchbrackets", 0}, {"matchbrackets", 0},

View File

@ -1270,7 +1270,7 @@ void add_undo(undo_type action)
u->mark_begin_lineno = openfile->mark_begin->lineno; u->mark_begin_lineno = openfile->mark_begin->lineno;
u->mark_begin_x = openfile->mark_begin_x; u->mark_begin_x = openfile->mark_begin_x;
u->xflags = MARK_WAS_SET; 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. */ /* The entire line is being cut regardless of the cursor position. */
u->begin = 0; u->begin = 0;
u->xflags = WAS_WHOLE_LINE; 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->cutbottom = u->cutbottom->next;
u->lineno = u->mark_begin_lineno + u->cutbottom->lineno - u->lineno = u->mark_begin_lineno + u->cutbottom->lineno -
u->cutbuffer->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); u->begin = strlen(u->cutbottom->data);
if (u->lineno == u->mark_begin_lineno) if (u->lineno == u->mark_begin_lineno)
u->begin += u->mark_begin_x; u->begin += u->mark_begin_x;