From 256af6322b1c219b56997b37a0c69070b53bcc86 Mon Sep 17 00:00:00 2001 From: Reto Brunner Date: Sun, 8 Nov 2020 13:39:25 +0100 Subject: allow the loading of existing headers --- commands/compose/header.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/commands/compose/header.go b/commands/compose/header.go index dd0adee..e4d7c40 100644 --- a/commands/compose/header.go +++ b/commands/compose/header.go @@ -56,18 +56,20 @@ func (Header) Execute(aerc *widgets.Aerc, args []string) error { composer, _ := aerc.SelectedTab().(*widgets.Composer) + value := strings.Join(args[optind+1:], " ") + if !force { headers, err := composer.PrepareHeader() if err != nil { return err } - if headers.Has(args[optind]) { + if headers.Has(args[optind]) && value != "" { return fmt.Errorf("Header %s already exists", args[optind]) } } - composer.AddEditor(args[optind], strings.Join(args[optind+1:], " "), false) + composer.AddEditor(args[optind], value, false) return nil } -- cgit 1.4.1-2-gfad0