Fix reversed selections

This commit is contained in:
Andras Schmelczer 2025-08-25 16:27:25 +01:00
parent 491a601ad2
commit 02ec098283
No known key found for this signature in database
GPG key ID: FC8F2C3D3D1A718C

View file

@ -104,7 +104,10 @@ export class CursorTracker {
relative_path: relativePath,
document_id: record.documentId,
vault_update_id: record.metadata.parentVersionId,
cursors
cursors: cursors.map(({ start, end }) => ({
start: Math.min(start, end),
end: Math.max(start, end)
})) // the client might send directional selections
});
}