Skip to content

Commit

Permalink
composer: add focus-body option
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Robin Jarry <[email protected]>
  • Loading branch information
maunke authored and rjarry committed Nov 10, 2024
1 parent 7f28ba1 commit 1a3b2b2
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/compose.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions config/aerc.conf
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,12 @@
# Default: false
#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
Expand Down
1 change: 1 addition & 0 deletions config/compose.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
}

Expand Down
5 changes: 5 additions & 0 deletions doc/aerc-config.5.scd
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1a3b2b2

Please sign in to comment.