y-codemirror.next icon indicating copy to clipboard operation
y-codemirror.next copied to clipboard

Remote Selection Ribbon Doesn't Match That Remote User's Version

Open seflless opened this issue 4 years ago • 3 comments

The selection ribbon doesn't fill to the right on the first line of multiple selections, for the remote user.

To Reproduce Steps to reproduce the behavior:

  1. Use Google Chrome to open demo page in two tabs, put each tab's window side by side, left and right
  2. Set the following as the editor content:
const i = 10;
const j = i+1;
  1. On the left tab select from just after the ; on the first line, through to the last ; on the second line
  2. You should be seeing something like the following code-mirror-ribbon

Expected behavior Ribbon for the remainder of the top line in a remote user's multi-line selection should match what the remote user sees. See rounded rectangle on the right of the above screenshot

Environment Information

  • Browser: Chrome
  • macOS: macOS Big Sur 11.6
  • Versions: Latest demo on https://github.com/yjs/y-codemirror.next

seflless avatar Dec 13 '21 18:12 seflless

@dmonad Could you give me some pointers to where the logic/data-structures are for the awareness protocol related to text selection?

seflless avatar Dec 13 '21 18:12 seflless

Hi @seflless, This is located in the y-protocols package.

dmonad avatar Dec 14 '21 14:12 dmonad

I fixed this issue in y-codemirror. The fix, however, is quite complicated and required some extensive logic. I'll leave this issue open as I don't think it's too important.

dmonad avatar Mar 25 '22 10:03 dmonad