From 60b6cc6d6da5b0f004cea0ca82940e8fd5560ad7 Mon Sep 17 00:00:00 2001 From: Humza Shahid Date: Wed, 15 Oct 2025 10:01:50 +0100 Subject: [PATCH] better naming of functions to create search/char highlight --- fcore/text-builder/text-builder-utils.sml | 6 +++--- fcore/text-builder/text-builder-with-cursor.sml | 6 ++++-- fcore/text-builder/text-builder-with-highlight.sml | 8 ++++---- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/fcore/text-builder/text-builder-utils.sml b/fcore/text-builder/text-builder-utils.sml index b6c6214..a9fb3da 100644 --- a/fcore/text-builder/text-builder-utils.sml +++ b/fcore/text-builder/text-builder-utils.sml @@ -157,7 +157,7 @@ struct , #cursorB env ) - fun makeHighlight (posX, posY, env: env_data) = + fun makeSearchHighlight (posX, posY, env: env_data) = Rect.lerp ( Real32.fromInt (posX - 2) , Real32.fromInt posY @@ -184,7 +184,7 @@ struct , #charB env ) - fun makeCursorOnChr (chr, posX, posY, env: env_data) = + fun makeCursorHighlightedChr (chr, posX, posY, env: env_data) = CozetteAscii.make ( chr , Real32.fromInt posX @@ -198,7 +198,7 @@ struct , #cursorHighlightedCharB env ) - fun makeHighlightChr (chr, posX, posY, env: env_data) = + fun makeSearchHighlightedChr (chr, posX, posY, env: env_data) = CozetteAscii.make ( chr , Real32.fromInt posX diff --git a/fcore/text-builder/text-builder-with-cursor.sml b/fcore/text-builder/text-builder-with-cursor.sml index 48c5863..fb6b56e 100644 --- a/fcore/text-builder/text-builder-with-cursor.sml +++ b/fcore/text-builder/text-builder-with-cursor.sml @@ -226,8 +226,10 @@ struct let val acc = if absIdx = cursorIdx then - let val acc = Utils.makeCursor (posX, posY, env) :: acc - in Utils.makeCursorOnChr (chr, posX, posY, env) :: acc + let + val acc = Utils.makeCursor (posX, posY, env) :: acc + in + Utils.makeCursorHighlightedChr (chr, posX, posY, env) :: acc end else Utils.makeChr (chr, posX, posY, env) :: acc diff --git a/fcore/text-builder/text-builder-with-highlight.sml b/fcore/text-builder/text-builder-with-highlight.sml index bc55aeb..84c6e88 100644 --- a/fcore/text-builder/text-builder-with-highlight.sml +++ b/fcore/text-builder/text-builder-with-highlight.sml @@ -146,7 +146,7 @@ struct acc val acc = if PersistentVector.isInRange (absIdx, #searchList env) then - Utils.makeHighlight (posX, posY, env) :: acc + Utils.makeSearchHighlight (posX, posY, env) :: acc else acc val posX = @@ -231,11 +231,11 @@ struct let val acc = if absIdx = cursorIdx then - Utils.makeCursorOnChr (chr, posX, posY, env) + Utils.makeCursorHighlightedChr (chr, posX, posY, env) :: Utils.makeCursor (posX, posY, env) :: acc else if PersistentVector.isInRange (absIdx, #searchList env) then - Utils.makeHighlightChr (chr, posX, posY, env) - :: Utils.makeHighlight (posX, posY, env) :: acc + Utils.makeSearchHighlightedChr (chr, posX, posY, env) + :: Utils.makeSearchHighlight (posX, posY, env) :: acc else Utils.makeChr (chr, posX, posY, env) :: acc in