From 916e94eaaaf8ea2540e97ce957fce25c0c7eb771 Mon Sep 17 00:00:00 2001 From: Humza Shahid Date: Sat, 13 Sep 2025 02:48:07 +0100 Subject: [PATCH] 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. --- fcore/text-builder/text-builder-with-cursor.sml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fcore/text-builder/text-builder-with-cursor.sml b/fcore/text-builder/text-builder-with-cursor.sml index 45751c8..2275404 100644 --- a/fcore/text-builder/text-builder-with-cursor.sml +++ b/fcore/text-builder/text-builder-with-cursor.sml @@ -58,7 +58,7 @@ struct else (* bin search lines *) let - val searchPos = BinSearch.equalOrMore (pos + 1, #searchList env) + val searchPos = BinSearch.equalOrMore (pos + 1, line) in if searchPos = ~1 then (* next line is not in this node *)