add visualScrollColumn' field to app type, which will record the scroll position for us

This commit is contained in:
2025-09-11 15:26:30 +01:00
parent 5e7f311dc7
commit e85ac5e806
3 changed files with 21 additions and 0 deletions

View File

@@ -17,6 +17,8 @@ struct
, startLine: int
(* absolute index of movable cursor *)
, cursorIdx: int
(* column to start drawing text at for horizontal scrolling. *)
, visualScrollColumn: int
(* msgs to send after an update.
* The list of messages is reset on each invocation of AppUpdate.update. *)
, msgs: MailboxType.t list
@@ -32,6 +34,7 @@ struct
, windowHeight = windowHeight
, startLine = 0
, cursorIdx = 0
, visualScrollColumn = 0
, msgs = []
}
end

View File

@@ -23,6 +23,7 @@ struct
, searchString
, startLine
, cursorIdx
, visualScrollColumn
} = app
in
{ mode = mode
@@ -35,6 +36,7 @@ struct
, searchString = searchString
, startLine = startLine
, cursorIdx = cursorIdx
, visualScrollColumn = visualScrollColumn
}
end
@@ -60,6 +62,7 @@ struct
, searchString
, windowWidth
, windowHeight
, visualScrollColumn
} = app
in
{ mode = newMode
@@ -72,6 +75,7 @@ struct
, searchString = searchString
, windowWidth = windowWidth
, windowHeight = windowHeight
, visualScrollColumn = visualScrollColumn
}
end
@@ -88,6 +92,7 @@ struct
, windowWidth
, windowHeight
, startLine
, visualScrollColumn
} = app
in
{ mode = newMode
@@ -100,6 +105,7 @@ struct
, windowWidth = windowWidth
, windowHeight = windowHeight
, startLine = startLine
, visualScrollColumn = visualScrollColumn
}
end
@@ -116,6 +122,7 @@ struct
, windowWidth
, windowHeight
, startLine
, visualScrollColumn
} = app
in
{ mode = newMode
@@ -128,6 +135,7 @@ struct
, windowWidth = windowWidth
, windowHeight = windowHeight
, startLine = startLine
, visualScrollColumn = visualScrollColumn
}
end
@@ -151,6 +159,7 @@ struct
, windowWidth
, windowHeight
, startLine
, visualScrollColumn
} = app
in
{ searchList = newSearchList
@@ -163,6 +172,7 @@ struct
, windowWidth = windowWidth
, windowHeight = windowHeight
, startLine = startLine
, visualScrollColumn = visualScrollColumn
}
end
end

View File

@@ -23,6 +23,7 @@ struct
, windowWidth
, windowHeight
, cursorIdx
, visualScrollColumn
} = app
in
{ mode = newMode
@@ -35,6 +36,7 @@ struct
, windowWidth = windowWidth
, windowHeight = windowHeight
, cursorIdx = cursorIdx
, visualScrollColumn = visualScrollColumn
}
end
@@ -52,6 +54,7 @@ struct
, windowWidth
, windowHeight
, cursorIdx
, visualScrollColumn
} = app
in
{ mode = newMode
@@ -64,6 +67,7 @@ struct
, windowWidth = windowWidth
, windowHeight = windowHeight
, cursorIdx = cursorIdx
, visualScrollColumn = visualScrollColumn
}
end
@@ -80,6 +84,7 @@ struct
, windowWidth
, windowHeight
, cursorIdx
, visualScrollColumn
} = app
in
{ mode = mode
@@ -92,6 +97,7 @@ struct
, windowWidth = windowWidth
, windowHeight = windowHeight
, cursorIdx = cursorIdx
, visualScrollColumn = visualScrollColumn
}
end
@@ -109,6 +115,7 @@ struct
, startLine
, bufferModifyTime
, cursorIdx
, visualScrollColumn
} = app
in
{ mode = mode
@@ -121,6 +128,7 @@ struct
, searchString = searchString
, bufferModifyTime = bufferModifyTime
, cursorIdx = cursorIdx
, visualScrollColumn = visualScrollColumn
}
end
end