mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-25 18:20:09 +02:00
Clamp minimum valid doc position to 0 (#27461)
GitOrigin-RevId: d531e2b5351b41217ccc8385f8f317cce91a840b
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user