From e56648029f2231a58ed4afbbe804b845e02fde62 Mon Sep 17 00:00:00 2001 From: Tim Culverhouse Date: Mon, 21 Mar 2022 18:23:47 -0500 Subject: compose: make headerEditor focusing more reliable Focusing header editors was hardcoded as integers which only worked with the default ui. If a user changed the UI to, for example, put CC as a field below "to", FocusSubject would focus the CC field instead of the subject. This commit reuses and modifies the function FocusEditor to generalize the focusing of header editors - which can now be called by name via FocusEditor(name string) Signed-off-by: Tim Culverhouse Acked-by: Robin Jarry --- commands/msg/forward.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'commands') diff --git a/commands/msg/forward.go b/commands/msg/forward.go index 9cc13c0..c8e04f1 100644 --- a/commands/msg/forward.go +++ b/commands/msg/forward.go @@ -94,7 +94,7 @@ func (forward) Execute(aerc *widgets.Aerc, args []string) error { tab := aerc.NewTab(composer, subject) if !h.Has("to") { - composer.FocusRecipient() + composer.FocusEditor("to") } else { composer.FocusTerminal() } -- cgit v1.2.3