Clamp minimum valid doc position to 0 (#27461)

GitOrigin-RevId: d531e2b5351b41217ccc8385f8f317cce91a840b
This commit is contained in:
Alf Eaton
2025-07-29 11:31:32 +01:00
committed by Copybot
parent 68d3d63e34
commit d3668bddec

View File

@@ -5,6 +5,10 @@ export const findValidPosition = (
lineNumber: number, // 1-indexed
columnNumber = 0 // 0-indexed
): number => {
if (lineNumber < 1) {
return 0
}
const lines = doc.lines
if (lineNumber > lines) {