mirror of
git://git.sv.gnu.org/nano.git
synced 2024-11-26 06:39:43 +03:00
tweaks: rename a constant, to match the corresponding option
This commit is contained in:
parent
63c428ad08
commit
1e2d9a697a
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
@ -489,7 +489,7 @@ enum
|
||||
USE_MOUSE,
|
||||
USE_REGEXP,
|
||||
TEMP_FILE,
|
||||
CUT_TO_END,
|
||||
CUT_FROM_CURSOR,
|
||||
BACKWARDS_SEARCH,
|
||||
MULTIBUFFER,
|
||||
SMOOTH_SCROLL,
|
||||
|
@ -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';
|
||||
|
@ -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},
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user