diff --git a/fcore/text-builder/text-builder-with-cursor.sml b/fcore/text-builder/text-builder-with-cursor.sml index 7478026..2273bc0 100644 --- a/fcore/text-builder/text-builder-with-cursor.sml +++ b/fcore/text-builder/text-builder-with-cursor.sml @@ -168,6 +168,14 @@ struct Utils.makeCursor (posX, posY, env) :: acc else acc + val posX = + if column < #scrollColumnStart env then + (* if we are prior to the start column, + * we want to set the x position to be at the start + * in preparation for when we are at the start column *) + #startX env + else + posX + TC.xSpace in build ( pos + 1 @@ -175,7 +183,7 @@ struct , stl , line , ltl - , posX + TC.xSpace + , posX , posY , column + 1 , lineNumber diff --git a/fcore/text-builder/text-builder-with-highlight.sml b/fcore/text-builder/text-builder-with-highlight.sml index fe5101b..a2183f2 100644 --- a/fcore/text-builder/text-builder-with-highlight.sml +++ b/fcore/text-builder/text-builder-with-highlight.sml @@ -208,6 +208,9 @@ struct Utils.makeHighlight (posX, posY, env) :: acc else acc + val posX = + if column < #scrollColumnStart env then #startX env + else posX + TC.xSpace in build ( pos + 1 @@ -215,7 +218,7 @@ struct , stl , line , ltl - , posX + TC.xSpace + , posX , posY , column + 1 , lineNumber