Fix cursor movement on Windows
This commit is contained in:
parent
a0044badf3
commit
5328e3b0f6
1 changed files with 30 additions and 38 deletions
|
|
@ -13,7 +13,7 @@ export function lineAndColumnToPosition(
|
|||
line: number,
|
||||
column: number
|
||||
): number {
|
||||
const lines = text.split("\n");
|
||||
const lines = text.replace("\r", "").split("\n");
|
||||
|
||||
if (line >= lines.length) {
|
||||
throw new Error(`Line number ${line} is out of range.`);
|
||||
|
|
|
|||
Loading…
Reference in a new issue