From: Sebastien Binet <s@sbinet.org>
use the currently selected message part (if any) as the original message for quote-reply.
honor viewer::alternatives if no message part was selected.
Signed-off-by: Sebastien Binet <s@sbinet.org>
---
commands/msg/reply.go | 23 ++++++++++++++++++-----
1 file changed, 18 insertions(+), 5 deletions(-)
diff --git a/commands/msg/reply.go b/commands/msg/reply.go
index 4b3e7c8..3b02ca1 100644
--- a/commands/msg/reply.go+++ b/commands/msg/reply.go
@@ -222,11 +222,24 @@ func (r reply) Execute(args []string) error {
return nil
}
- var part []int- for _, mime := range config.Viewer.Alternatives {- part = lib.FindMIMEPart(mime, msg.BodyStructure, nil)- if part != nil {- break+ part := func() []int {+ provider, ok := app.SelectedTabContent().(app.ProvidesMessage)+ if !ok {+ return nil+ }+ p := provider.SelectedMessagePart()+ if p == nil {+ return nil+ }+ return p.Index+ }()++ if part == nil {+ for _, mime := range config.Viewer.Alternatives {+ part = lib.FindMIMEPart(mime, msg.BodyStructure, nil)+ if part != nil {+ break+ } }
}
--
2.43.0
On Mon Jan 8, 2024 at 5:04 PM CET, Sebastien Binet wrote:
> From: Sebastien Binet <s@sbinet.org>>> use the currently selected message part (if any) as the original message for quote-reply.> honor viewer::alternatives if no message part was selected.>> Signed-off-by: Sebastien Binet <s@sbinet.org>> ---
Hi Sebastien, thanks for the patch. Looks good to me.
Do you think it would make sense to add the same logic to the :forward
command [1] as well (for equivalence)?
[1]: https://git.sr.ht/~rjarry/aerc/tree/master/item/commands/msg/forward.go#L146-150
On Tue Jan 9, 2024 at 08:22 CET, Koni Marti wrote:
> On Mon Jan 8, 2024 at 5:04 PM CET, Sebastien Binet wrote:> > From: Sebastien Binet <s@sbinet.org>> >> > use the currently selected message part (if any) as the original message for quote-reply.> > honor viewer::alternatives if no message part was selected.> >> > Signed-off-by: Sebastien Binet <s@sbinet.org>> > --->> Hi Sebastien, thanks for the patch. Looks good to me.>> Do you think it would make sense to add the same logic to the :forward> command [1] as well (for equivalence)?
you're right.
I'll send a v2.
-s