diff options
Diffstat (limited to 'commands')
-rw-r--r-- | commands/msgview/save.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/commands/msgview/save.go b/commands/msgview/save.go index 350739ab..2a5eadf9 100644 --- a/commands/msgview/save.go +++ b/commands/msgview/save.go @@ -30,7 +30,16 @@ func (Save) Aliases() []string { } func (Save) Complete(aerc *widgets.Aerc, args []string) []string { + _, optind, _ := getopt.Getopts(args, "fpa") + if optind < len(args) { + args = args[optind:] + } path := strings.Join(args, " ") + defaultPath := aerc.Config().General.DefaultSavePath + if defaultPath != "" && !isAbsPath(path) { + path = filepath.Join(defaultPath, path) + } + path, _ = homedir.Expand(path) return commands.CompletePath(path) } |