Renaming 'to_end' to 'to_eof', to lessen confusion with CUT_TO_END.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4979 35c25a1d-7b9e-4130-9fde-d3aeb78583b8master
parent
a872709ab4
commit
c55c0db2bb
|
@ -1,3 +1,7 @@
|
||||||
|
2014-06-18 Benno Schulenberg <bensberg@justemail.net>
|
||||||
|
* src/text.c: Rename 'to_end' to 'to_eof', to lessen confusion
|
||||||
|
with CUT_TO_END (which is about cutting to end-of-line).
|
||||||
|
|
||||||
2014-06-18 Mark Majeres <mark@engine12.com>
|
2014-06-18 Mark Majeres <mark@engine12.com>
|
||||||
* src/text.c (add_undo): Don't start a new undo for CUT when the
|
* src/text.c (add_undo): Don't start a new undo for CUT when the
|
||||||
cutbuffer is being preserved, because then the cuts are contiguous
|
cutbuffer is being preserved, because then the cuts are contiguous
|
||||||
|
|
|
@ -344,8 +344,8 @@ typedef struct undo {
|
||||||
/* Copy of cutbottom. */
|
/* Copy of cutbottom. */
|
||||||
bool mark_set;
|
bool mark_set;
|
||||||
/* Was the marker set when we cut? */
|
/* Was the marker set when we cut? */
|
||||||
bool to_end;
|
bool to_eof;
|
||||||
/* Was this a cut to end? */
|
/* Was this a cut to the end-of-file? */
|
||||||
ssize_t mark_begin_lineno;
|
ssize_t mark_begin_lineno;
|
||||||
/* copy copy copy */
|
/* copy copy copy */
|
||||||
size_t mark_begin_x;
|
size_t mark_begin_x;
|
||||||
|
|
12
src/text.c
12
src/text.c
|
@ -425,7 +425,7 @@ void redo_cut(undo *u)
|
||||||
openfile->mark_set = TRUE;
|
openfile->mark_set = TRUE;
|
||||||
|
|
||||||
openfile->mark_begin_x = (u->xflags == UNcut_cutline) ? 0 : u->mark_begin_x;
|
openfile->mark_begin_x = (u->xflags == UNcut_cutline) ? 0 : u->mark_begin_x;
|
||||||
do_cut_text(FALSE, u->to_end, TRUE);
|
do_cut_text(FALSE, u->to_eof, TRUE);
|
||||||
openfile->mark_set = FALSE;
|
openfile->mark_set = FALSE;
|
||||||
openfile->mark_begin = NULL;
|
openfile->mark_begin = NULL;
|
||||||
openfile->mark_begin_x = 0;
|
openfile->mark_begin_x = 0;
|
||||||
|
@ -892,11 +892,11 @@ void add_undo(undo_type current_action)
|
||||||
u->strdata2 = NULL;
|
u->strdata2 = NULL;
|
||||||
u->cutbuffer = NULL;
|
u->cutbuffer = NULL;
|
||||||
u->cutbottom = NULL;
|
u->cutbottom = NULL;
|
||||||
u->mark_set = 0;
|
u->mark_set = FALSE;
|
||||||
u->mark_begin_lineno = fs->current->lineno;
|
u->mark_begin_lineno = fs->current->lineno;
|
||||||
u->mark_begin_x = fs->current_x;
|
u->mark_begin_x = fs->current_x;
|
||||||
u->xflags = 0;
|
u->xflags = 0;
|
||||||
u->to_end = FALSE;
|
u->to_eof = FALSE;
|
||||||
|
|
||||||
switch (u->type) {
|
switch (u->type) {
|
||||||
/* We need to start copying data into the undo buffer
|
/* We need to start copying data into the undo buffer
|
||||||
|
@ -939,7 +939,7 @@ void add_undo(undo_type current_action)
|
||||||
u->strdata = data;
|
u->strdata = data;
|
||||||
break;
|
break;
|
||||||
case CUT_EOF:
|
case CUT_EOF:
|
||||||
u->to_end = TRUE;
|
u->to_eof = TRUE;
|
||||||
case CUT:
|
case CUT:
|
||||||
cutbuffer_reset();
|
cutbuffer_reset();
|
||||||
u->mark_set = openfile->mark_set;
|
u->mark_set = openfile->mark_set;
|
||||||
|
@ -947,7 +947,7 @@ void add_undo(undo_type current_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;
|
||||||
}
|
}
|
||||||
else if (!ISSET(CUT_TO_END) && !u->to_end) {
|
else if (!ISSET(CUT_TO_END) && !u->to_eof) {
|
||||||
/* 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 = UNcut_cutline;
|
u->xflags = UNcut_cutline;
|
||||||
|
@ -1076,7 +1076,7 @@ void update_undo(undo_type action)
|
||||||
u->cutbottom = u->cutbuffer;
|
u->cutbottom = u->cutbuffer;
|
||||||
while (u->cutbottom->next != NULL)
|
while (u->cutbottom->next != NULL)
|
||||||
u->cutbottom = u->cutbottom->next;
|
u->cutbottom = u->cutbottom->next;
|
||||||
if (!u->to_end)
|
if (!u->to_eof)
|
||||||
u->lineno++;
|
u->lineno++;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue