diff options
author | Kevin Kuehler <keur@ocf.berkeley.edu> | 2019-07-17 00:35:50 -0700 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2019-07-19 11:30:32 -0400 |
commit | f81e4bd41c3ba9427390eadfc5133ed8daada6ab (patch) | |
tree | 1c815a23a33005dbd51bc0c4c1c1e1234fe696a5 /commands/account/cf.go | |
parent | 8b2abcb02a191ad77c971fd4679c7d177ce2f827 (diff) | |
download | aerc-f81e4bd41c3ba9427390eadfc5133ed8daada6ab.tar.gz |
Implement :filter, :clear
Signed-off-by: Kevin Kuehler <keur@ocf.berkeley.edu>
Diffstat (limited to 'commands/account/cf.go')
-rw-r--r-- | commands/account/cf.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/commands/account/cf.go b/commands/account/cf.go index 6c928ea..2ebc294 100644 --- a/commands/account/cf.go +++ b/commands/account/cf.go @@ -34,14 +34,20 @@ func (_ ChangeFolder) Execute(aerc *widgets.Aerc, args []string) error { if acct == nil { return errors.New("No account selected") } + store := acct.Store() + if store == nil { + return errors.New("Cannot perform action. Messages still loading") + } previous := acct.Directories().Selected() if args[1] == "-" { if dir, ok := history[acct.Name()]; ok { + store.ApplyClear() acct.Directories().Select(dir) } else { return errors.New("No previous folder to return to") } } else { + store.ApplyClear() acct.Directories().Select(args[1]) } history[acct.Name()] = previous |