Commit Graph

11 Commits

Author SHA1 Message Date
090e7ccea2 pass 'maxLength' value to TextScroll function so that we can prevent scrolling past the bottom of the file (unless we want to od so by centtering the screen) 2025-09-19 23:17:28 +01:00
f1a06f946d add searchScrollColumn to NORMAL_SEARCH_MODE variant, and update and recalculate it where needed 2025-09-14 09:50:07 +01:00
b556fc7d63 extract a reusable function to calculate the scroll column in different contexts (can be used for a plain string or a LineGap.t; doesn't matter) 2025-09-14 09:22:37 +01:00
7a388f2983 add TextScroll function for centering line to cursor, and use it in 'NormalFinish.centreToCursor' function 2025-09-13 18:23:55 +01:00
2a332f543a minor adjustment to vertical TextScroll: we shouldn't need to move the cursor to the very line in the visible area, or the ver first line in the visible area, to scroll. We scroll if the cursorLine is some distance close to either edge instead. 2025-09-13 05:24:51 +01:00
668dd07699 pull in new version of brolib-sml so that we can get bug fixes for LineGap.getLineNumberOfIdx, delete the TextWindow structure (which was previously used to get the start line to draw from), and replace previous usages of TextWindow with TextScroll.getStartLine. This enables us to scroll in a way tailored to the reimplemented TextBuilder (which do not wrap lines or characters) 2025-09-13 05:12:17 +01:00
a99b6c8df8 implement smoother horizontal scrolling. If the new column is already visible without changing the previous scroll column, then don't change. If the new scroll column is prior to the old, then scroll backwards; else, scroll forwards. 2025-09-13 01:43:31 +01:00
f2ec6b80c2 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) 2025-09-13 01:03:44 +01:00
dfb7ecb867 add new function to calculate the startLine 2025-09-11 17:30:49 +01:00
580f014481 fix getScrollColumn calculation: the right calculation is to subtract the column number by how many columns we can fit 2025-09-11 17:09:43 +01:00
77439acef6 add function to get the appropriate scroll column 2025-09-11 16:17:56 +01:00