speller: hook up a marked-text alternative spellcheck to the undo system

master
David Lawrence Ramsey 2018-07-30 15:53:03 -05:00 committed by Benno Schulenberg
parent 7f6460b804
commit 115f089d5f
1 changed files with 6 additions and 0 deletions

View File

@ -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 */