From f2ec6b80c2fb1d15bc319203b0e413031325d742 Mon Sep 17 00:00:00 2001 From: Humza Shahid Date: Sat, 13 Sep 2025 01:03:44 +0100 Subject: [PATCH] fix bug when the cursor is on the last column of a horizontally-scrollable line. Before this commit, the last column/character was not visible. Now it is. We fixed this by decrementing the 'howManyColumnsCanWeFit' value in the 'TesxtScroll.getScrollColumn' function by 1. This works because it was an off-by-one error that caused this bug in the first place (we didn't previously count column 0 as visible and taking up space) --- fcore/text-scroll.sml | 1 + 1 file changed, 1 insertion(+) diff --git a/fcore/text-scroll.sml b/fcore/text-scroll.sml index fb8dfef..3807921 100644 --- a/fcore/text-scroll.sml +++ b/fcore/text-scroll.sml @@ -15,6 +15,7 @@ struct val howManyColumnsCanWeFit = if windowWidth >= TC.textLineWidth then TC.textLineCount else windowWidth div TC.xSpace + val howManyColumnsCanWeFit = howManyColumnsCanWeFit - 1 in if columnDifference < howManyColumnsCanWeFit then 0 else columnDifference - howManyColumnsCanWeFit