From df7b0a6d977d13c669c097f825de52081492f9b1 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Mon, 28 Mar 2022 11:38:22 +0200 Subject: [PATCH] execute: clear an anchor only when the whole buffer gets filtered Although an anchor at the top line is rather pointless, it shouldn't get cleared when the user pipes just a part of the buffer through an external command. --- src/files.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/files.c b/src/files.c index 4d64b25e..9c598e1f 100644 --- a/src/files.c +++ b/src/files.c @@ -1070,7 +1070,8 @@ bool execute_command(const char *command) } add_undo(CUT, NULL); do_snip(openfile->mark != NULL, openfile->mark == NULL, FALSE); - openfile->filetop->has_anchor = FALSE; + if (openfile->filetop->next == NULL) + openfile->filetop->has_anchor = FALSE; update_undo(CUT); }