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:
@@ -3047,36 +3047,39 @@ struct
|
|||||||
, lineLength
|
, lineLength
|
||||||
} = buffer
|
} = buffer
|
||||||
in
|
in
|
||||||
(* we compare current line with searchLine - 1
|
if searchLine <= 0 then
|
||||||
* because if searchLine - 1 is here,
|
LineGap.goToStart buffer
|
||||||
* that means we can access the linebreak
|
|
||||||
* that starts searchLine *)
|
|
||||||
if searchLine - 1 < line then
|
|
||||||
helpGoToLineLeft
|
|
||||||
( idx
|
|
||||||
, line
|
|
||||||
, searchLine
|
|
||||||
, leftStrings
|
|
||||||
, leftLines
|
|
||||||
, rightStrings
|
|
||||||
, rightLines
|
|
||||||
, textLength
|
|
||||||
, lineLength
|
|
||||||
)
|
|
||||||
else if searchLine - 1 > line then
|
|
||||||
helpGoToLineRight
|
|
||||||
( idx
|
|
||||||
, line
|
|
||||||
, searchLine
|
|
||||||
, leftStrings
|
|
||||||
, leftLines
|
|
||||||
, rightStrings
|
|
||||||
, rightLines
|
|
||||||
, textLength
|
|
||||||
, lineLength
|
|
||||||
)
|
|
||||||
else
|
else
|
||||||
buffer
|
(* we compare current line with searchLine - 1
|
||||||
|
* because if searchLine - 1 is here,
|
||||||
|
* that means we can access the linebreak
|
||||||
|
* that starts searchLine *)
|
||||||
|
(if searchLine - 1 < line then
|
||||||
|
helpGoToLineLeft
|
||||||
|
( idx
|
||||||
|
, line
|
||||||
|
, searchLine
|
||||||
|
, leftStrings
|
||||||
|
, leftLines
|
||||||
|
, rightStrings
|
||||||
|
, rightLines
|
||||||
|
, textLength
|
||||||
|
, lineLength
|
||||||
|
)
|
||||||
|
else if searchLine - 1 > line then
|
||||||
|
helpGoToLineRight
|
||||||
|
( idx
|
||||||
|
, line
|
||||||
|
, searchLine
|
||||||
|
, leftStrings
|
||||||
|
, leftLines
|
||||||
|
, rightStrings
|
||||||
|
, rightLines
|
||||||
|
, textLength
|
||||||
|
, lineLength
|
||||||
|
)
|
||||||
|
else
|
||||||
|
buffer)
|
||||||
end
|
end
|
||||||
|
|
||||||
fun helpGoToIdxLeft
|
fun helpGoToIdxLeft
|
||||||
|
|||||||
Reference in New Issue
Block a user