rjkroege / edwood

Go version of Plan9 Acme Editor
Other
380 stars 34 forks source link

Event file missing chorded messages. #470

Open knusbaum opened 1 year ago

knusbaum commented 1 year ago

It looks to me like the event file does not report chorded events as it does in acme, and as it says in acme(4).

acme(4):

[The event flag will contain bit] 8 if the command has an extra (chorded) argument; if so, two more complete messages will follow reporting the argument (with all numbers 0 except the character count) and where it originated, in the form of a fully-qualified button 3 style address.

In acme, selecting an Edit replacement, e.g. ,s|foo|bar|g and then chording the edit command Button3-1, results in the following events:

Event: [Mx19 23 9 4 Edit]
Event: [Mx0 0 0 12 ,s|foo|bar|g]
Event: [Mx0 0 0 0 ]

This matches the description in the manual page.

In Edwood however, the 8th bit of the flag is not set when chording, and no subsequent messages are received:

Event: [Mx21 25 1 4 Edit]

To be clear, chording appears to behave correctly in Edwood windows, but the events don't show up in the events file as expected.

paul-lalonde commented 1 year ago

This may relate to another bug that has kicked me occasionally where instead of receiving chorded text I receive the address of the chorded text. I haven't worked out the reproduction steps yet, but will the next time I see it.

On Fri, Dec 2, 2022 at 11:00 AM Kyle Nusbaum @.***> wrote:

It looks to me like the event file does not report chorded events as it does in acme, and as it says in acme(4).

acme(4):

[The event flag will contain bit] 8 if the command has an extra (chorded) argument; if so, two more complete messages will follow reporting the argument (with all numbers 0 except the character count) and where it originated, in the form of a fully-qualified button 3 style address.

In acme, selecting an Edit replacement, e.g. ,s|foo|bar|g and then chording the edit command Button3-1, results in the following events:

Event: [Mx19 23 9 4 Edit] Event: [Mx0 0 0 12 ,s|foo|bar|g] Event: [Mx0 0 0 0 ]

This matches the description in the manual page.

In Edwood however, the 8th bit of the flag is not set when chording, and no subsequent messages are received:

Event: [Mx21 25 1 4 Edit]

To be clear, chording appears to behave correctly in Edwood windows, but the events don't show up in the events file as expected.

— Reply to this email directly, view it on GitHub https://github.com/rjkroege/edwood/issues/470, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJ6RUGQO74SVJBMMLXKPK3WLJBMNANCNFSM6AAAAAASSGTWVQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

rjkroege commented 1 year ago

I'll have a look.

rjkroege commented 1 year ago

Notes for trying to replicate this in Edwood (dd8fcfc668f6a5a2eb8fb574b2280a214cb649ff):

9p read acme/105/event
...
Mx54 54 11 0
Mx53 57 0 4 Edit
Mx0 0 0 33 /Users/rjkroege/lib/tools:#47,#59
Mx0 0 0 12 ,x:^: i:>  :

In Acme (e2a141ae0952c2d28a9f500bb9da6dc72e57be3c):

Mx55 55 11 0
Mx53 57 0 4 Edit
Mx0 0 0 11 x:^: i:// :
Mx0 0 0 0

Observations:

rjkroege commented 1 year ago

exec.go:/func.*execute() would seem responsible for the generation of event output. The block handling commands executed while the window's event fid is open has no tests. 😛