shithub: mongrel

Download patch

ref: 11c473e818fc3a0aa7ca096b5dac7dd0f124ac20
parent: 92db4c42d5aa5542922ae24a54f7db88ac50cfbb
author: phil9 <telephil9@gmail.com>
date: Mon Feb 14 07:26:50 EST 2022

fix right-click menu acting on the wrong message

	when right-clicking in the pager we were still setting the selection to another message
	leading to acting on the wrong message.
	Only change selection if we're using middle click in the index instead.

--- a/index.c
+++ b/index.c
@@ -334,15 +334,18 @@
 	n = menuhit(but, mctl, &menu, nil);
 	switch(n){
 	case Mraw:
-		select(indexat(m.xy), selc);
+		if(ptinrect(m.xy, listr))
+			select(indexat(m.xy), selc);
 		rawmsg(messageat(sel));
 		break;
 	case Mplumb:
-		select(indexat(m.xy), selc);
+		if(ptinrect(m.xy, listr))
+			select(indexat(m.xy), selc);
 		plumbmsg(messageat(sel));
 		break;
 	case Mdelete:
-		select(indexat(m.xy), selc);
+		if(ptinrect(m.xy, listr))
+			select(indexat(m.xy), selc);
 		mesgdel(mbox, messageat(sel));
 		break;
 	}