(ids: string[])
| 941 | // lines down inside the region and the line from the start had to reach |
| 942 | // past everything above it to get there. |
| 943 | const topmost = (ids: string[]): string | null => |
| 944 | ids |
| 945 | .filter((id) => pos.has(id)) |
| 946 | .sort((a, b) => pos.get(a)!.line - pos.get(b)!.line || pos.get(a)!.x - pos.get(b)!.x)[0] ?? null; |
| 947 | const entry = |
| 948 | topmost(region.members.filter((m) => fromAnchor.has(m.id)).map((m) => m.id)) ?? |
| 949 | topmost(region.members.map((m) => m.id)) ?? |