aboutsummaryrefslogtreecommitdiffstats
path: root/widgets
diff options
context:
space:
mode:
authorKoni Marti <koni.marti@gmail.com>2022-11-20 23:40:40 +0100
committerRobin Jarry <robin@jarry.cc>2022-11-21 13:31:05 +0100
commite0a2f3090be425f8a9138af40bd4d96890bf9f8f (patch)
tree09e1791fd69d80e465e77918a57efb024ff3444d /widgets
parent116032cdac58e541ad3bc4fdf8a1ee5f51a77965 (diff)
downloadaerc-e0a2f3090be425f8a9138af40bd4d96890bf9f8f.tar.gz
msgviewer: fix parts index
Fix parts index by making an explicit copy of the index slice. Fixes: https://todo.sr.ht/~rjarry/aerc/103 Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'widgets')
-rw-r--r--widgets/msgviewer.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/widgets/msgviewer.go b/widgets/msgviewer.go
index c15187ae..ea28165e 100644
--- a/widgets/msgviewer.go
+++ b/widgets/msgviewer.go
@@ -528,7 +528,7 @@ const copying int32 = 1
func NewPartViewer(acct *AccountView, conf *config.AercConfig,
msg lib.MessageView, part *models.BodyStructure,
- index []int,
+ curindex []int,
) (*PartViewer, error) {
var (
filter *exec.Cmd
@@ -618,6 +618,9 @@ func NewPartViewer(acct *AccountView, conf *config.AercConfig,
{Strategy: ui.SIZE_WEIGHT, Size: ui.Const(1)},
})
+ index := make([]int, len(curindex))
+ copy(index, curindex)
+
pv := &PartViewer{
conf: conf,
acctConfig: acct.AccountConfig(),