Skip to content

Commit 4949f0f

Browse files
committed
feat: send multiple cursor positions without repeating buffer (#15)
1 parent 4158be9 commit 4949f0f

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

proto/cursor.proto

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ service Cursor {
99
// Retrieves all current cursor positions.
1010
rpc List(common.Empty) returns (CursorEventList);
1111
// Subscribe to a workspace's cursor events.
12-
rpc Attach (stream cursor.CursorPosition) returns (stream cursor.CursorEvent);
12+
rpc Attach (stream CursorUpdate) returns (stream CursorEvent);
1313
}
1414

1515
// A message representing a list of cursor events.
@@ -26,20 +26,26 @@ message RowCol {
2626
required int32 col = 2;
2727
}
2828

29-
// A message representing cursor position.
29+
// A message representing a cursor position.
3030
message CursorPosition {
31-
// The buffer where the cursor is located.
32-
required files.BufferNode buffer = 1;
3331
// The cursor's start position.
34-
required RowCol start = 2;
32+
required RowCol start = 1;
3533
// The cursor's end position.
36-
required RowCol end = 3;
34+
required RowCol end = 2;
35+
}
36+
37+
// A message representing an update to the cursor position.
38+
message CursorUpdate {
39+
// The buffer where the cursor is located.
40+
required files.BufferNode buffer = 1;
41+
// A vector of cursor positions.
42+
repeated CursorPosition = 2;
3743
}
3844

3945
// A message representing a cursor event.
4046
message CursorEvent {
4147
// The user moving the cursor.
4248
required common.Identifier user = 1;
4349
// The new cursor position.
44-
repeated CursorPosition position = 2;
50+
repeated CursorUpdate position = 2;
4551
}

0 commit comments

Comments
 (0)