Redoing an Enter from stored undo data, instead of running do_enter() again,
because the latter behaves differently depending on the setting of autoindent. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5400 35c25a1d-7b9e-4130-9fde-d3aeb78583b8master
parent
619f28077c
commit
f1d9fcc77b
|
@ -1,3 +1,9 @@
|
||||||
|
2015-11-11 Benno Schulenberg <bensberg@justemail.net>
|
||||||
|
* src/text.c (do_redo, update_undo): Redo an Enter from the stored
|
||||||
|
undo data, instead of running do_enter() again, because the latter
|
||||||
|
will behave differently depending on the setting of autoindent.
|
||||||
|
This addresses Debian bug #793053 reported by Clancy.
|
||||||
|
|
||||||
2015-11-10 Benno Schulenberg <bensberg@justemail.net>
|
2015-11-10 Benno Schulenberg <bensberg@justemail.net>
|
||||||
* src/winio.c (edit_draw): Skip a zero-length match only when there
|
* src/winio.c (edit_draw): Skip a zero-length match only when there
|
||||||
/is/ a match. Found with valgrind. This fixes Savannah bug #41908.
|
/is/ a match. Found with valgrind. This fixes Savannah bug #41908.
|
||||||
|
|
14
src/text.c
14
src/text.c
|
@ -677,8 +677,17 @@ void do_redo(void)
|
||||||
break;
|
break;
|
||||||
case ENTER:
|
case ENTER:
|
||||||
redidmsg = _("line break");
|
redidmsg = _("line break");
|
||||||
goto_line_posx(u->lineno, u->begin);
|
filestruct *shoveline = make_new_node(f);
|
||||||
do_enter(TRUE);
|
shoveline->data = mallocstrcpy(NULL, u->strdata);
|
||||||
|
data = mallocstrncpy(NULL, f->data, u->begin + 1);
|
||||||
|
data[u->begin] = '\0';
|
||||||
|
free(f->data);
|
||||||
|
f->data = data;
|
||||||
|
splice_node(f, shoveline, f->next);
|
||||||
|
if (f == openfile->filebot)
|
||||||
|
openfile->filebot = shoveline;
|
||||||
|
renumber(shoveline);
|
||||||
|
goto_line_posx(u->lineno + 1, u->mark_begin_x);
|
||||||
break;
|
break;
|
||||||
#ifndef DISABLE_WRAPPING
|
#ifndef DISABLE_WRAPPING
|
||||||
case SPLIT_BEGIN:
|
case SPLIT_BEGIN:
|
||||||
|
@ -1156,6 +1165,7 @@ fprintf(stderr, " >> Updating... action = %d, fs->last_action = %d, openfile->c
|
||||||
u->mark_begin_lineno = openfile->current->lineno;
|
u->mark_begin_lineno = openfile->current->lineno;
|
||||||
break;
|
break;
|
||||||
case ENTER:
|
case ENTER:
|
||||||
|
u->strdata = mallocstrcpy(NULL, fs->current->data);
|
||||||
u->mark_begin_x = fs->current_x;
|
u->mark_begin_x = fs->current_x;
|
||||||
break;
|
break;
|
||||||
#ifndef DISABLE_WRAPPING
|
#ifndef DISABLE_WRAPPING
|
||||||
|
|
Loading…
Reference in New Issue