tweaks: rename another constant, to be more precise

master
Benno Schulenberg 2017-07-14 16:18:41 +02:00
parent 1e2d9a697a
commit 14c5f03e38
3 changed files with 8 additions and 8 deletions

View File

@ -248,9 +248,9 @@ void do_copy_text(void)
/* Cut from the current cursor position to the end of the file. */ /* Cut from the current cursor position to the end of the file. */
void do_cut_till_eof(void) void do_cut_till_eof(void)
{ {
add_undo(CUT_EOF); add_undo(CUT_TO_EOF);
do_cut_text(FALSE, TRUE); do_cut_text(FALSE, TRUE);
update_undo(CUT_EOF); update_undo(CUT_TO_EOF);
} }
#endif /* !NANO_TINY */ #endif /* !NANO_TINY */

View File

@ -158,7 +158,7 @@ typedef enum {
} update_type; } update_type;
typedef enum { typedef enum {
ADD, DEL, BACK, CUT, CUT_EOF, REPLACE, ADD, DEL, BACK, CUT, CUT_TO_EOF, REPLACE,
#ifndef DISABLE_WRAPPING #ifndef DISABLE_WRAPPING
SPLIT_BEGIN, SPLIT_END, SPLIT_BEGIN, SPLIT_END,
#endif #endif

View File

@ -748,7 +748,7 @@ void do_undo(void)
splice_node(f, t); splice_node(f, t);
goto_line_posx(u->lineno, u->begin); goto_line_posx(u->lineno, u->begin);
break; break;
case CUT_EOF: case CUT_TO_EOF:
case CUT: case CUT:
undidmsg = _("text cut"); undidmsg = _("text cut");
undo_cut(u); undo_cut(u);
@ -926,7 +926,7 @@ void do_redo(void)
renumber(f); renumber(f);
goto_line_posx(u->mark_begin_lineno, u->mark_begin_x); goto_line_posx(u->mark_begin_lineno, u->mark_begin_x);
break; break;
case CUT_EOF: case CUT_TO_EOF:
case CUT: case CUT:
redidmsg = _("text cut"); redidmsg = _("text cut");
redo_cut(u); redo_cut(u);
@ -1261,7 +1261,7 @@ void add_undo(undo_type action)
case REPLACE: case REPLACE:
u->strdata = mallocstrcpy(NULL, openfile->current->data); u->strdata = mallocstrcpy(NULL, openfile->current->data);
break; break;
case CUT_EOF: case CUT_TO_EOF:
cutbuffer_reset(); cutbuffer_reset();
break; break;
case CUT: case CUT:
@ -1395,7 +1395,7 @@ fprintf(stderr, " >> Updating... action = %d, openfile->last_action = %d, openf
#endif #endif
break; break;
} }
case CUT_EOF: case CUT_TO_EOF:
case CUT: case CUT:
if (!cutbuffer) if (!cutbuffer)
break; break;
@ -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_FROM_CURSOR) || u->type == CUT_EOF) { if (ISSET(CUT_FROM_CURSOR) || u->type == CUT_TO_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;