commit 115f089d5f8e54a326e5a70f1092e78f88d60599
parent 7f6460b804427d82250a4ac297333dc8b818f9da
Author: David Lawrence Ramsey <pooka109@gmail.com>
Date: Mon, 30 Jul 2018 15:53:03 -0500
speller: hook up a marked-text alternative spellcheck to the undo system
Diffstat:
1 file changed, 6 insertions(+), 0 deletions(-)
diff --git a/src/files.c b/src/files.c
@@ -566,9 +566,13 @@ void replace_marked_buffer(const char *filename)
/* Don't add a magicline when replacing text in the buffer. */
SET(NO_NEWLINES);
+ add_undo(COUPLE_BEGIN);
+
/* Throw away the text under the mark. */
cutbuffer = NULL;
+ add_undo(CUT);
do_cut_text(FALSE, TRUE, FALSE);
+ update_undo(CUT);
free_filestruct(cutbuffer);
cutbuffer = was_cutbuffer;
@@ -578,6 +582,8 @@ void replace_marked_buffer(const char *filename)
/* Restore the magicline behavior now that we're done fiddling. */
if (!old_no_newlines)
UNSET(NO_NEWLINES);
+
+ add_undo(COUPLE_END);
}
#endif /* !NANO_TINY */
#endif /* ENABLE_SPELLER */