Not speaking of "line wrap" but of "text add" when undoing/redoing

text additions that caused automatic line breaks.
Patch by Mark Majeres.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5064 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
master
Benno Schulenberg 2014-07-11 19:14:25 +00:00
parent 300e27745b
commit 5dde918e24
2 changed files with 15 additions and 6 deletions

View File

@ -1,3 +1,8 @@
2014-07-11 Mark Majeres <mark@engine12.com>
* src/text.c (do_undo, do_redo): Do not speak of "line wrap"
but instead of "text add" when undoing/redoing text additions
that caused automatic line breaks.
2014-07-11 Benno Schulenberg <bensberg@justemail.net> 2014-07-11 Benno Schulenberg <bensberg@justemail.net>
* src/files.c (write_lockfile): Refix typo in error message. * src/files.c (write_lockfile): Refix typo in error message.

View File

@ -433,7 +433,7 @@ void do_undo(void)
undo *u = openfile->current_undo; undo *u = openfile->current_undo;
filestruct *t = 0; filestruct *t = 0;
size_t len = 0; size_t len = 0;
char *undidmsg, *data; char *data, *undidmsg = NULL;
if (!u) { if (!u) {
statusbar(_("Nothing in undo buffer!")); statusbar(_("Nothing in undo buffer!"));
@ -476,7 +476,6 @@ void do_undo(void)
break; break;
#ifndef DISABLE_WRAPPING #ifndef DISABLE_WRAPPING
case SPLIT_END: case SPLIT_END:
undidmsg = _("line wrap");
goto_line_posx(u->lineno, u->begin); goto_line_posx(u->lineno, u->begin);
openfile->current_undo = openfile->current_undo->next; openfile->current_undo = openfile->current_undo->next;
openfile->last_action = OTHER; openfile->last_action = OTHER;
@ -484,6 +483,8 @@ void do_undo(void)
do_undo(); do_undo();
u = openfile->current_undo; u = openfile->current_undo;
f = openfile->current; f = openfile->current;
case SPLIT_BEGIN:
undidmsg = _("text add");
break; break;
#endif /* !DISABLE_WRAPPING */ #endif /* !DISABLE_WRAPPING */
case JOIN: case JOIN:
@ -554,7 +555,8 @@ void do_undo(void)
break; break;
} }
statusbar(_("Undid action (%s)"), undidmsg); if (undidmsg)
statusbar(_("Undid action (%s)"), undidmsg);
renumber(f); renumber(f);
openfile->current_undo = openfile->current_undo->next; openfile->current_undo = openfile->current_undo->next;
@ -568,7 +570,7 @@ void do_redo(void)
{ {
undo *u = openfile->undotop; undo *u = openfile->undotop;
size_t len = 0; size_t len = 0;
char *redidmsg, *data; char *data, *redidmsg = NULL;
for (; u != NULL && u->next != openfile->current_undo; u = u->next) for (; u != NULL && u->next != openfile->current_undo; u = u->next)
; ;
@ -622,7 +624,6 @@ void do_redo(void)
break; break;
#ifndef DISABLE_WRAPPING #ifndef DISABLE_WRAPPING
case SPLIT_BEGIN: case SPLIT_BEGIN:
redidmsg = _("line wrap");
goto_line_posx(u->lineno, u->begin); goto_line_posx(u->lineno, u->begin);
openfile->current_undo = u; openfile->current_undo = u;
openfile->last_action = OTHER; openfile->last_action = OTHER;
@ -630,6 +631,8 @@ void do_redo(void)
do_redo(); do_redo();
u = openfile->current_undo; u = openfile->current_undo;
goto_line_posx(u->lineno, u->begin); goto_line_posx(u->lineno, u->begin);
case SPLIT_END:
redidmsg = _("text add");
break; break;
#endif /* !DISABLE_WRAPPING */ #endif /* !DISABLE_WRAPPING */
case JOIN: case JOIN:
@ -675,7 +678,8 @@ void do_redo(void)
break; break;
} }
statusbar(_("Redid action (%s)"), redidmsg); if (redidmsg)
statusbar(_("Redid action (%s)"), redidmsg);
openfile->current_undo = u; openfile->current_undo = u;
openfile->last_action = OTHER; openfile->last_action = OTHER;