Fix cursor movement on Windows

This commit is contained in:
Andras Schmelczer 2025-04-03 21:44:45 +01:00
commit 5328e3b0f6
No known key found for this signature in database
GPG key ID: FC8F2C3D3D1A718C

View file

@ -19,10 +19,9 @@ describe("lineAndColumnToPosition", () => {
expect(position).toBe(0);
});
it("should handle a single-line string correctly", () => {
const text = "SingleLine";
const position = lineAndColumnToPosition(text, 0, 5);
expect(position).toBe(5);
it("with carrige return", () => {
expect(lineAndColumnToPosition("a\nb", 1, 1)).toBe(3);
expect(lineAndColumnToPosition("a\r\nb", 1, 1)).toBe(3);
});
it("should handle multi-line strings with varying lengths", () => {