special case LineGap.goToLine, when the line requested to go to is 0. When this happens, we call 'LineGap.goToStart'.

This commit is contained in:
2025-12-03 00:31:57 +00:00
parent 4925bcd370
commit 7a8961af9c

View File

@@ -3047,11 +3047,14 @@ struct
, lineLength , lineLength
} = buffer } = buffer
in in
if searchLine <= 0 then
LineGap.goToStart buffer
else
(* we compare current line with searchLine - 1 (* we compare current line with searchLine - 1
* because if searchLine - 1 is here, * because if searchLine - 1 is here,
* that means we can access the linebreak * that means we can access the linebreak
* that starts searchLine *) * that starts searchLine *)
if searchLine - 1 < line then (if searchLine - 1 < line then
helpGoToLineLeft helpGoToLineLeft
( idx ( idx
, line , line
@@ -3076,7 +3079,7 @@ struct
, lineLength , lineLength
) )
else else
buffer buffer)
end end
fun helpGoToIdxLeft fun helpGoToIdxLeft