commit 667fcea65ed32ca09055e893f493e899e9b5ae0f
parent c39c9c241b2e17dce62f5bec07b6755d12484d90
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Sat, 4 Aug 2018 09:51:32 +0200
undo: differentiate between general filtering and spell checking
With-help-from: David Lawrence Ramsey <pooka109@gmail.com>
Diffstat:
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/src/files.c b/src/files.c
@@ -523,6 +523,7 @@ void replace_buffer(const char *filename)
#ifndef NANO_TINY
add_undo(COUPLE_BEGIN);
+ openfile->undotop->strdata = mallocstrcpy(NULL, _("spelling correction"));
#endif
/* Throw away the text of the file. */
@@ -544,6 +545,7 @@ void replace_buffer(const char *filename)
#ifndef NANO_TINY
add_undo(COUPLE_END);
+ openfile->undotop->strdata = mallocstrcpy(NULL, _("spelling correction"));
#endif
}
@@ -567,6 +569,7 @@ void replace_marked_buffer(const char *filename)
SET(NO_NEWLINES);
add_undo(COUPLE_BEGIN);
+ openfile->undotop->strdata = mallocstrcpy(NULL, _("spelling correction"));
/* Throw away the text under the mark. */
cutbuffer = NULL;
@@ -584,6 +587,7 @@ void replace_marked_buffer(const char *filename)
UNSET(NO_NEWLINES);
add_undo(COUPLE_END);
+ openfile->undotop->strdata = mallocstrcpy(NULL, _("spelling correction"));
}
#endif /* !NANO_TINY */
#endif /* ENABLE_SPELLER */
diff --git a/src/text.c b/src/text.c
@@ -796,7 +796,7 @@ void do_undo(void)
cutbottom = oldcutbottom;
break;
case COUPLE_BEGIN:
- undidmsg = _("filtering");
+ undidmsg = u->strdata;
break;
case COUPLE_END:
openfile->current_undo = openfile->current_undo->next;
@@ -968,7 +968,7 @@ void do_redo(void)
do_redo();
return;
case COUPLE_END:
- redidmsg = _("filtering");
+ redidmsg = u->strdata;
break;
case INDENT:
handle_indent_action(u, FALSE, TRUE);
@@ -1182,6 +1182,7 @@ bool execute_command(const char *command)
#endif
{
add_undo(COUPLE_BEGIN);
+ openfile->undotop->strdata = mallocstrcpy(NULL, _("filtering"));
if (openfile->mark == NULL) {
openfile->current = openfile->fileage;
openfile->current_x = 0;
@@ -1231,8 +1232,10 @@ bool execute_command(const char *command)
else
read_file(stream, 0, "pipe", TRUE);
- if (should_pipe && !ISSET(MULTIBUFFER))
+ if (should_pipe && !ISSET(MULTIBUFFER)) {
add_undo(COUPLE_END);
+ openfile->undotop->strdata = mallocstrcpy(NULL, _("filtering"));
+ }
if (wait(NULL) == -1)
nperror("wait");