~rjarry/aerc

1a3b2b24eb5179f0a87bc4f0d3c9b1b9cf18d14d — Markus Unkel 24 days ago 7f28ba1
composer: add focus-body option

When the composer window opens, an user might want to start writing
the email body before adding a subject and recipients. Setting the
focus-body option to true achieves that by setting the focus to the
editor.

Signed-off-by: Markus Unkel <markus@unkel.io>
Acked-by: Robin Jarry <robin@jarry.cc>

4 files changed, 13 insertions(+), 1 deletions(-)

M app/compose.go
M config/aerc.conf
M config/compose.go
M doc/aerc-config.5.scd
M app/compose.go => app/compose.go +1 -1
@@ 1276,7 1276,7 @@ func (c *Composer) showTerminal() error {
	c.focusable = append(c.focusable, c.editor)
	c.review = nil
	c.updateGrid()
	if c.editHeaders {
	if c.editHeaders || config.Compose.FocusBody {
		c.focusTerminalPriv()
	}
	return nil

M config/aerc.conf => config/aerc.conf +6 -0
@@ 655,6 655,12 @@
#edit-headers=false

#
# Sets focus to the email body when the composer window opens.
#
# Default: false
#focus-body=false

#
# Specifies the command to be used to tab-complete email addresses. Any
# occurrence of "%s" in the address-book-cmd will be replaced with what the
# user has typed so far.

M config/compose.go => config/compose.go +1 -0
@@ 17,6 17,7 @@ type ComposeConfig struct {
	FilePickerCmd       string         `ini:"file-picker-cmd"`
	FormatFlowed        bool           `ini:"format-flowed"`
	EditHeaders         bool           `ini:"edit-headers"`
	FocusBody           bool           `ini:"focus-body"`
	LFEditor            bool           `ini:"lf-editor"`
}


M doc/aerc-config.5.scd => doc/aerc-config.5.scd +5 -0
@@ 883,6 883,11 @@ These options are configured in the *[compose]* section of _aerc.conf_.

	Default: _false_

*focus-body* = _true_|_false_
	Sets focus to the email body when the composer window opens.

	Default: _false_

*address-book-cmd* = _<command>_
	Specifies the command to be used to tab-complete email addresses. Any
	occurrence of _%s_ in the *address-book-cmd* will be replaced with anything