new feature: a bindable 'zap', to erase text without changing cutbuffer

This function allows the user to "make space": annihilating lines or
regions while keeping intact for pasting the stuff in the cutbuffer
that was cut or copied earlier.

Signed-off-by: Brand Huntsman <alpha@qzx.com>
This commit is contained in:
Brand Huntsman
2018-10-23 20:25:22 -06:00
committed by Benno Schulenberg
parent 02eaa4ce6d
commit 5662a38802
8 changed files with 70 additions and 16 deletions

View File

@@ -533,7 +533,7 @@ void replace_buffer(const char *filename)
#ifndef NANO_TINY
add_undo(CUT_TO_EOF);
#endif
do_cut_text(FALSE, FALSE, TRUE);
do_cut_text(FALSE, FALSE, TRUE, FALSE);
#ifndef NANO_TINY
update_undo(CUT_TO_EOF);
#endif
@@ -574,7 +574,7 @@ void replace_marked_buffer(const char *filename)
/* Throw away the text under the mark. */
cutbuffer = NULL;
add_undo(CUT);
do_cut_text(FALSE, TRUE, FALSE);
do_cut_text(FALSE, TRUE, FALSE, FALSE);
update_undo(CUT);
free_filestruct(cutbuffer);
cutbuffer = was_cutbuffer;