in cut_marked_segment(), respect concatenate_cut, as we need to use it
if we do a marked cut and immediately follow it with a cut-to-end (which uses that function) git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2095 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
Этот коммит содержится в:
родитель
bfb98f8bd4
Коммит
649b431171
@ -114,6 +114,10 @@ CVS code -
|
||||
handle this. (DLR)
|
||||
- Convert some ints with predefined boundaries to enums. (DLR)
|
||||
- cut.c:
|
||||
cut_marked_segment()
|
||||
- Respect concatenate_cut, as we need to use it if we do a
|
||||
marked cut and immediately follow it with a cut-to-end (which
|
||||
uses this function). (DLR)
|
||||
do_cut_text()
|
||||
- Set concatenate_cut to TRUE unconditionally when doing a
|
||||
marked cut. This fixes an incompatibility with Pico where an
|
||||
|
21
src/cut.c
21
src/cut.c
@ -59,8 +59,8 @@ void add_to_cutbuffer(filestruct *inptr, bool allow_concat)
|
||||
cutbuffer = inptr;
|
||||
#ifndef NANO_SMALL
|
||||
else if (allow_concat && concatenate_cut) {
|
||||
/* Just tack the text in inptr onto the text in cutbottom,
|
||||
* unless allow_concat is FALSE. */
|
||||
/* If allow_concat is TRUE and we're concatenating, tack the
|
||||
* text in inptr onto the text in cutbottom. */
|
||||
cutbottom->data = charealloc(cutbottom->data,
|
||||
strlen(cutbottom->data) + strlen(inptr->data) + 1);
|
||||
strcat(cutbottom->data, inptr->data);
|
||||
@ -120,10 +120,27 @@ void cut_marked_segment(void)
|
||||
cutbuffer = tmp;
|
||||
cutbottom = tmp;
|
||||
} else {
|
||||
if (concatenate_cut) {
|
||||
/* If we're concatenating, tack the text in the first line
|
||||
* of tmp onto the text in the bottom of the cutbuffer, and
|
||||
* move tmp one line down to where its next line begins. */
|
||||
cutbottom->data = charealloc(cutbottom->data,
|
||||
strlen(cutbottom->data) + strlen(tmp->data) + 1);
|
||||
strcat(cutbottom->data, tmp->data);
|
||||
tmp = tmp->next;
|
||||
}
|
||||
|
||||
/* Put tmp on the line after the bottom of the cutbuffer. */
|
||||
cutbottom->next = tmp;
|
||||
|
||||
if (!concatenate_cut) {
|
||||
/* Tf we're not concatenating, attach tmp to the bottom of
|
||||
* the cutbuffer, and then move the bottom of the cutbuffer
|
||||
* one line down to where tmp is. */
|
||||
tmp->prev = cutbottom;
|
||||
cutbottom = tmp;
|
||||
}
|
||||
}
|
||||
|
||||
/* And make the top remainder line manually too. Update current_x
|
||||
* and totlines to account for all the cut text, and update totsize
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user