fix getScrollColumn calculation: the right calculation is to subtract the column number by how many columns we can fit
This commit is contained in:
@@ -17,6 +17,7 @@ struct
|
|||||||
(* calculate scroll column *)
|
(* calculate scroll column *)
|
||||||
val buffer = LineGap.goToIdx (cursorIdx, buffer)
|
val buffer = LineGap.goToIdx (cursorIdx, buffer)
|
||||||
val visualScrollColumn = TextScroll.getScrollColumn (buffer, cursorIdx, windowWidth)
|
val visualScrollColumn = TextScroll.getScrollColumn (buffer, cursorIdx, windowWidth)
|
||||||
|
val () = print (Int.toString visualScrollColumn ^ "\n")
|
||||||
|
|
||||||
(* move LineGap to first line displayed on screen *)
|
(* move LineGap to first line displayed on screen *)
|
||||||
val buffer = LineGap.goToLine (startLine, buffer)
|
val buffer = LineGap.goToLine (startLine, buffer)
|
||||||
|
|||||||
@@ -16,7 +16,9 @@ struct
|
|||||||
if windowWidth >= TC.textLineWidth then TC.textLineCount
|
if windowWidth >= TC.textLineWidth then TC.textLineCount
|
||||||
else windowWidth div TC.xSpace
|
else windowWidth div TC.xSpace
|
||||||
in
|
in
|
||||||
columnDifference mod howManyColumnsCanWeFit
|
if columnDifference < howManyColumnsCanWeFit then 0
|
||||||
|
else
|
||||||
|
columnDifference - howManyColumnsCanWeFit
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user