Add command history and cycling

Aerc will keep track of the previous 1000 commands, which the user can
cycle through using the arrow keys while in the ex-line. Pressing up
will move backwards in history while pressing down will move forward.
This commit is contained in:
Galen Abell 2019-07-23 12:52:33 -04:00 committed by Drew DeVault
parent 67fb0938a6
commit 8635c70fda
7 changed files with 113 additions and 8 deletions
widgets

View file

@ -51,7 +51,8 @@ func NewComposer(conf *config.AercConfig,
defaults["From"] = acct.From
}
layout, editors, focusable := buildComposeHeader(conf.Compose.HeaderLayout, defaults)
layout, editors, focusable := buildComposeHeader(
conf.Compose.HeaderLayout, defaults)
header, headerHeight := layout.grid(
func(header string) ui.Drawable { return editors[header] },
@ -90,7 +91,11 @@ func NewComposer(conf *config.AercConfig,
return c
}
func buildComposeHeader(layout HeaderLayout, defaults map[string]string) (newLayout HeaderLayout, editors map[string]*headerEditor, focusable []ui.DrawableInteractive) {
func buildComposeHeader(layout HeaderLayout, defaults map[string]string) (
newLayout HeaderLayout,
editors map[string]*headerEditor,
focusable []ui.DrawableInteractive,
) {
editors = make(map[string]*headerEditor)
focusable = make([]ui.DrawableInteractive, 0)