for LineGap.lineNumberToIdx function, add a branch at the start checking if we are trying to get the idx corresponding to line number 0. This is needed by the current implementation because the 'lineNumberToIdxLeft' function uses (findLine - 1) in the implementation, and (0 - 1) is an invalid line idx as it is below 0.
This commit is contained in:
@@ -3341,7 +3341,9 @@ struct
|
||||
, ...
|
||||
} = buffer
|
||||
in
|
||||
if findLine - 1 < curLine then
|
||||
if findLine = 0 then
|
||||
0
|
||||
else if findLine - 1 < curLine then
|
||||
lineNumberToIdxLeft (findLine, curIdx, curLine, leftStrings, leftLines)
|
||||
else
|
||||
lineNumberToIdxRight
|
||||
|
||||
Reference in New Issue
Block a user