commit c39c9c241b2e17dce62f5bec07b6755d12484d90
parent 115f089d5f8e54a326e5a70f1092e78f88d60599
Author: David Lawrence Ramsey <pooka109@gmail.com>
Date: Mon, 30 Jul 2018 17:07:43 -0500
undo: actually enable undoing/redoing an alternative spellcheck
Make sure the inserts of the spell-checked text are undoable, and no
longer discard the undo stack after running the alternate spell checker.
Diffstat:
2 files changed, 3 insertions(+), 9 deletions(-)
diff --git a/src/files.c b/src/files.c
@@ -540,7 +540,7 @@ void replace_buffer(const char *filename)
cutbuffer = was_cutbuffer;
/* Insert the processed file into its place. */
- read_file(f, descriptor, filename, FALSE);
+ read_file(f, descriptor, filename, TRUE);
#ifndef NANO_TINY
add_undo(COUPLE_END);
@@ -577,7 +577,7 @@ void replace_marked_buffer(const char *filename)
cutbuffer = was_cutbuffer;
/* Insert the processed file where the marked text was. */
- read_file(f, descriptor, filename, FALSE);
+ read_file(f, descriptor, filename, TRUE);
/* Restore the magicline behavior now that we're done fiddling. */
if (!old_no_newlines)
diff --git a/src/text.c b/src/text.c
@@ -2906,14 +2906,8 @@ const char *do_alt_speller(char *tempfile_name)
/* Stat the temporary file again, and mark the buffer as modified only
* if this file was changed since it was written. */
stat(tempfile_name, &spellfileinfo);
- if (spellfileinfo.st_mtime != timestamp) {
+ if (spellfileinfo.st_mtime != timestamp)
set_modified();
-#ifndef NANO_TINY
- /* Flush the undo stack, to avoid making a mess when the user
- * tries to undo things in spell-corrected lines. */
- discard_until(NULL, openfile, FALSE);
-#endif
- }
#ifndef NANO_TINY
/* Unblock SIGWINCHes again. */