Commit Graph

11 Commits

Author SHA1 Message Date
97936b83a0 in TextBuilder functions, when we encounter a newline, we want any cursor here to be drawn after a linebreak (after the posX and posY values go to the next line) and not before 2025-09-16 22:29:19 +01:00
4bc6c54951 in TextBuilder.build functions, when we encounter a space, check if we are before the scroll column's start, and set the x position to startX if so. This is done in preparation for the character which is actually at the scroll column's start, which will be added at the wrong offset unless we do this. 2025-09-14 08:42:46 +01:00
2ab48626cd remove 'skipToFirstVisibleColumn' function in TextBuilder, as control flow is simpler if we have fewer mutually recursive functions and we can implement its functionality in the 'build' function instead. Also change the 'z' values for cursor and highlight; the cursor should appear above the highlight and now it does, but it previously didn't 2025-09-13 23:22:40 +01:00
a3b00e09d8 port over bug fixes from mutually recursive functions from test-builder-with-cursor.sml to text-builder-with-highlight.sml 2025-09-13 03:02:13 +01:00
916e94eaaa fix bug: when we want to skip to next line in TextBuilderWithCursor, we were using binary search on the search list. The search list contained the indices of matched searches, but what we wanted to use binary search on are the lines, as the lines can help us find the next linebreak if any. So, we perform binary search on the lines vector this time to fix the bug. 2025-09-13 02:48:07 +01:00
20a542df29 in BinSearch.equalOrMore and BinSearch.equalOrLess, return ~1 if no item is found, for the sake of less ambiguity in usage. Functions that call these have also been adapted. 2025-09-13 02:18:14 +01:00
295bdc35cf fix bug where some lines were not scrolling horizontally properly. The issue was that, when encountering a line break in 'skipToFirstVisualColumn' function, we should have recursively called the 'skipToFirstVisualColumn' function instead of the 'build' function. The reason is that our current column after a line break is 0, but we don't know if the start column to display is necessarily 0 in all cases. 2025-09-13 00:14:07 +01:00
b9e2da3ff9 add function to skip to first visible column in TextBuilderWithCursor (sometimes the function is buggy, which I need to fix) 2025-09-13 00:02:44 +01:00
422d6ad9ac fix bugs in implementing and using text buffer. Some functions did not save the drawMsg to the app's state, which we means we didn't draw in those cases. The text builder functions also drew cursors on characters even when the cursor is not at this position. Both of these bugs are fixed. 2025-09-12 23:21:53 +01:00
77a64ae794 previously forgot to draw char in text builder, but we do that now 2025-09-12 14:02:38 +01:00
b6de188f7d create a separate directory for different text builders 2025-09-12 08:57:17 +01:00